Commit Graph

60 Commits

Author SHA1 Message Date
drh
e0adf60241 Improved robustness against OOM in the expert extension.
FossilOrigin-Name: e732c429bafeffaf7e0f458213089c073c262a39eabb41b291e5006078ca7f98
2021-12-16 14:26:16 +00:00
dan
4baf43ff64 Add the "static" qualifier to some internal functions in code for various SQLite extensions.
FossilOrigin-Name: 8c986782547211098eb0e4e722eda0097421223af279381373d0055211b5e9d2
2021-12-01 11:03:50 +00:00
drh
11a9ad5669 Fix harmless static analyzer warnings in sessions, rtree, fts3 and fts5.
Add the -DSQLITE_OMIT_AUXILIARY_SAFETY_CHECKS compile-time option to cause
ALWAYS() and NEVER() macros to be omitted from the build.

FossilOrigin-Name: 1c67f957fc77e37ce8f0d447c41ca975e8e79a35d332739c24a633649b5b0387
2021-10-04 18:21:14 +00:00
drh
dd31c033c6 Fix harmless compiler warnings.
FossilOrigin-Name: d678ecca02698753d1b33e072566112e94ea36d0d3a8f4a24d2b09d131968d88
2021-09-22 14:43:35 +00:00
drh
fd7abcd15b Fix harmless compiler warnings in shell.c.in, and a compiler warning in
sqlite3expert.c which is a real error, though also harmless.

FossilOrigin-Name: 56da0e9c0321d1fd3c360722cd6284296f9ba459f6b37ab35c81ecabd18f12e3
2021-09-22 13:43:16 +00:00
larrybr
b565bee66b Fix .expert name collision bug reported at https://sqlite.org/forum/forumpost/05e6f32984561f57?t=h
FossilOrigin-Name: 4a3f98ad0dd2a8c0370042611a041bed2bd8d9ca82d6706e2db349eb97aaf1f0
2021-09-21 20:03:05 +00:00
drh
77ea22300b Fix an issue with the SQLite Expert extension when a column has no
collating sequence.
[forum:/forumpost/78165fa250|Forum post 78165fa250].

FossilOrigin-Name: b1e0c22ec981cf5f8a6597abc6711b1a25019dd51de31129fbc504d3dc743bb4
2021-07-08 12:12:39 +00:00
drh
8210233c7b Revise tests cases to align with the new EXPLAIN QUERY PLAN output.
FossilOrigin-Name: 50fbd532602d2c316813046ed6be8be2991c281eb5f295c4c28520a0de73862c
2021-03-20 15:11:29 +00:00
dan
69871baa15 Fix the expert extension so that it handles generated columns correctly.
FossilOrigin-Name: c2ae7ba6f8f4b10bd734051a0cfa8ed9675bd58c82ede4e9eadfd7cbcc03b82d
2020-12-11 14:22:44 +00:00
mistachkin
4338000d47 Prevent potential segfault in the sqlite-expert idxPopulateStat1 context cleanup code.
FossilOrigin-Name: c24f13448b5a55f45b4d4786a878fa73fe3395b5724f3bc2eea22e5e2b074353
2020-12-02 20:07:49 +00:00
dan
39c7125a97 Fix a problem in sqlite-expert causing it to ignore equality constraints on the second or subsequent columns of a multi-column PRIMARY KEY.
FossilOrigin-Name: c666c85a433fbc83edef4dbfb0399672e570f5d7979ab61cb39ff5488595d822
2020-09-17 17:01:16 +00:00
drh
067b92ba00 Extend the refactoring into extensions. Clean up stray newlines.
FossilOrigin-Name: 7a876209a678a34c198b54ceef9e3c041f128a14dc73357f6a57cadadaa6cf7b
2020-06-19 15:24:12 +00:00
dan
23e3c340b5 Avoid another potential OOB read in sqlite3expert.c.
FossilOrigin-Name: 0ccea80092f16e7f17f4c4de4f8be3fdef217199fcc08ace37e179c1b22c1294
2020-05-21 19:13:46 +00:00
dan
b2c6fe225a Update code in sqlite3expert.c to account for the fact that "-- TRIGGER xyz" VM comments are now omitted for some builds.
FossilOrigin-Name: 7cf93dc55c48c68731a1fe3ae3517fcfeb5c252bfa87e715a333c6194bcc0ace
2020-05-15 18:48:31 +00:00
dan
d48eafb984 Fix another build problem for SQLITE_OMIT_VIRTUALTABLE builds.
FossilOrigin-Name: 5e1eb0fa3afd74251bc8f484e3edfa81b15610479431af205bd952c91eecd21f
2020-05-15 16:19:35 +00:00
dan
00bd55e1ae Allow "main" to be used to refer to the main database even after SQLITE_DBCONFIG_MAINDBNAME has been used to assign another alias.
FossilOrigin-Name: 75c85ca32f9ae4a28fd8f8ff2f7639599413d22af706e9799a0e76cc560d14eb
2020-03-20 20:54:28 +00:00
mistachkin
b88eaf1619 Add header guard to the expert extension.
FossilOrigin-Name: 7e3151855fd4370fb7d4fff20516c2c2d1980134620df924106e6989bc130583
2019-11-13 18:50:36 +00:00
dan
37874d7dcc Disable broken test case in expert1.test.
FossilOrigin-Name: 73e30c2e92ccab274ff7cee48511c461de148786bb9d338921c1ecb193822282
2019-08-21 17:46:34 +00:00
drh
bd462bcc10 Improvements to EXPLAIN QUERY PLAN formatting. The MULTI-INDEX OR now shows
a separate "INDEX" subtree for each index.  SCALAR SUBQUERY entries provide
a subquery number that is related back to the .selecttrace output.

FossilOrigin-Name: 7153552bac51295c56a1c42ca79d57195851e232509f9e9610375692f48c7e86
2018-12-24 20:21:06 +00:00
drh
84c501bac1 Initial code to make shadow tables read-only to ordinary SQL. The now
xShadowName method is added to the sqlite3_module object and is used
to identify potential shadow tables.  The SQLITE_PREPARE_SHADOW argument
to sqlite3_prepare_v3() is defined.  It is designed to permit writing to
shadow tables, but is currently an unused placeholder.

FossilOrigin-Name: 31942b3dd3f66eb0d9977bf1cadc2f2d7be7967cce2b55784be0b939dfef1985
2018-11-05 23:01:45 +00:00
dan
c5861ce88f Fix some test case numbers in expert1.test.
FossilOrigin-Name: b90c3c16c04589583d2d1619320bb45a0b012c5960f23bd4e3f9dbe7c84b2eae
2018-06-13 16:08:22 +00:00
dan
1d40cdbd4b More minor changes to test scripts.
FossilOrigin-Name: ce9b756f09df4feb485bbf9695f8c6774906eb1b2fb45a340b74ffd21c9adfd8
2018-05-29 14:29:28 +00:00
drh
5d72d9245d Make a separate limb in the EXPLAIN QUERY PLAN output for the various lines
associated with the OR-optimization.

FossilOrigin-Name: 75ac7b4e4fd0811ca80c719badacff207e0bbd00ac64dde3b3d4ec676fad472d
2018-05-04 00:39:43 +00:00
drh
cdf88760da More test case updates. Tests are all running now.
FossilOrigin-Name: dab5e5294813891469660cceb211ac1a1e526715bb57dcdbb1ab90321e6a4dad
2018-05-02 19:42:33 +00:00
drh
cd90ca7ded Update the expert extension test cases to account for the fact that
EXPLAIN QUERY PLAN now shows the start of each trigger in its output.

FossilOrigin-Name: 8acb42f48929d908fe67a8536e240ca252a9ab780dce79eaa85b8fba35d52250
2018-04-24 16:51:38 +00:00
mistachkin
ac8ba26ecb Fix utility compilation issues with MSVC.
FossilOrigin-Name: 5bd5a79898790bef150b2bc7f275333444b1a723385e595931377ff4d32190bf
2018-03-07 14:42:17 +00:00
drh
b968518559 Fix harmless compiler warnings, mostly unused parameters for UDFs in the CLI.
FossilOrigin-Name: bfbeffab7735461acb3773242ba31dae15af9f8b0291c54a6734747bb1b36e66
2018-01-17 13:15:23 +00:00
dan
c48e0271f6 Fix a potential crash in sqlite3expert.c caused by a missing sqlite3_reset()
call.

FossilOrigin-Name: f6355970f04a3c4d85801c806366788139d8d5ad29383ec7faa81e2176ffe987
2018-01-09 18:31:11 +00:00
dan
f87ae41f52 Do not attempt to build the code in ext/expert/sqlite3expert.c if
SQLITE_OMIT_VIRTUALTABLE is defined.

FossilOrigin-Name: ba967ad2e38590fe2a51e814a087140089be5e6a06a795a958e70a8a47f6350f
2018-01-09 14:30:49 +00:00
dan
d4bb7c180b Fix problems in the sqlite3expert.c code revealed by -fsanitize.
FossilOrigin-Name: 7a93dd784bfdbf01927979a61643796e0901d9ac285fe4214677838def93a9a4
2018-01-08 17:34:15 +00:00
drh
efc88d020c Modify the new sqlite3_vtab_collation() interface so that it takes a
pointer to the sqlite3_index_info object passed into xBestIndex rather than
an sqlite3 connection pointer, which the xBestIndex method might not have
access to.

FossilOrigin-Name: 5c1fe6666019147a26480b5db1bf2f474a5d072c234c736f16ed5d2a9a040b3f
2017-12-22 00:52:50 +00:00
drh
36e31c6915 Change the name of SQLITE_DBCONFIG_FULL_EQP to be SQLITE_DBCONFIG_TRIGGER_EQP
(which we can do without breaking compatibility because the former name has
not yet appeared in an official release) and streamline its implementation.

FossilOrigin-Name: fffc7685d19f78ec322a4e834ad727af20a17e2e1c35680e4b1c4162c4786f60
2017-12-21 18:23:26 +00:00
drh
fafd6fbb49 Add the experimental ".expert" command to the sqlite3.exe shell.
FossilOrigin-Name: 0821bae7afefed98102c81104b4a477e81816bb1f43353c80865411771e3c5a7
2017-12-21 02:17:02 +00:00
dan
e42e1bc594 Fix crash in sqlite3_vtab_collation() when called for an IS NOT NULL
constraint.

FossilOrigin-Name: ad38d2c4f073705c02c7b38675e8ae86fe4a794d54eb796e7ed51a905824d5f5
2017-12-19 18:56:28 +00:00
dan
43efc18669 Experimentally add the SQLite expert functionality to the shell tool.
FossilOrigin-Name: 51068dbaeaef13bb80af8126b8c4f3a454dee63de5127d706db50bf789533e60
2017-12-19 17:42:13 +00:00
drh
bd0f1dbd06 Get sqlite3_expert building on Windows.
FossilOrigin-Name: d8254047b30f7c1be486bf39d4420678604573b951b5cc83c19ebf74aba0864c
2017-05-03 12:50:46 +00:00
drh
138bd6df41 In sqlite3expert.c, do not copy the schema for virtual tables. Updates to
makefiles to make building easier.

FossilOrigin-Name: da15752dccf6090e40ec825db89048eca2b30185882225bf81f1891e914c2e7f
2017-05-03 12:15:20 +00:00
drh
382bce037c In the sqlite3_expert command-line tool, allow two-dash options. Do not
accept the database name if it begins with "-".

FossilOrigin-Name: af7d1596044980e0a18baa3ab6674779724dffbf18a152c72e53f11a08999e68
2017-05-02 20:42:30 +00:00
drh
5034dc673d Merge the latest enhancements from trunk.
FossilOrigin-Name: a7dcf6a79f7e1c5884baee2909a4bf3174ae06d561dae87b390856e573f81b49
2017-05-02 19:45:14 +00:00
dan
f3ac8ba569 Another minor formatting fix.
FossilOrigin-Name: 9fa2ce3c2b75408594d387684984cd946765776d30bc622a1f4e64d6fe1856d5
2017-04-21 19:58:35 +00:00
dan
6b0fa916f5 Fix formatting errors in the previous commit.
FossilOrigin-Name: da9a2e5aa977f7e8e9e4365f7b34bb4f482029a3d44646100773cedc8ea9b959
2017-04-21 19:56:53 +00:00
dan
5b9dbd1ed0 Update the README.md file in the ext/expert/ directory.
FossilOrigin-Name: 3b2ff4e0692dfca395d4523b7d5cd0dfd5c319c1072a2a873631fa477cee0b79
2017-04-21 19:53:39 +00:00
dan
c42a0056d7 Merge latest trunk changes into this branch.
FossilOrigin-Name: b1533bc455f52f570c0f4b8aaa0da802757dc89b0e45b9a9b31aa591a44bf7bd
2017-04-20 17:35:46 +00:00
dan
bc3f784cd2 Speed this branch up a bit by filtering before the virtual table layer when
sampling user data.

FossilOrigin-Name: 8e57c31340dd9ffc457da63c5996fb1b573f8154f864ec2b52c15f399906ac8b
2017-04-20 16:43:32 +00:00
dan
2ed99def5b Avoid creating a temp table in the user database in the sqlite3_expert code.
Trouble is, this makes sampling for stat1 data much slower.

FossilOrigin-Name: c62e358243d96cb38a7ce2aa679fc640b62bf46080eab4bd5fc2acf5997d6cd5
2017-04-20 16:08:33 +00:00
dan
e53b4f9774 Add an option to generate stat1 data based on a subset of the user database
table contents to sqlite3_expert.

FossilOrigin-Name: c69c3e21db6e141f7e24226c6432f2ed31fe5f177bd23781915871f8600ee56a
2017-04-20 09:54:04 +00:00
dan
a6ed5a4f39 Have sqlite3_expert_analyze() populate the sqlite_stat1 table before running
queries through the planner for the second time.

FossilOrigin-Name: a157fcfde5afc27ae38e7cf4669fcc8e60e23d9d301ffe2e541dd69f895b493b
2017-04-18 20:10:16 +00:00
dan
7853002c71 Fix sqlite3_expert handling of triggers on views.
FossilOrigin-Name: ff4976da667872614331d88e68fb67d347874f164a1c7950dd738c7c2320b954
2017-04-18 09:04:48 +00:00
dan
280db65e2c Add support for analyzing trigger programs to the sqlite3_expert code.
FossilOrigin-Name: 159e8022a9d6701532b8b60e0c41154bc434c1bbdb107c8c97a78fb1140fa745
2017-04-17 17:03:08 +00:00
dan
2abf90096f Fix problems with handling constraints on the rowid column in sqlite3expert.c.
FossilOrigin-Name: 2e6308798ae2db30564deb35ba3896597448edabbcac6efc4ff084552e42de30
2017-04-15 16:52:12 +00:00