Commit Graph

4230 Commits

Author SHA1 Message Date
drh
8a4380d761 Fixes to EXPLAIN QUERY PLAN output. Change weights back to something closer
to what they are in legacy.  More test case fixes.

FossilOrigin-Name: 36373b85f9a97840aa06e24ae31c12fcfbae084e
2013-06-11 02:32:50 +00:00
drh
8636e9c55c Handle virtual tables correctly when using logarithmic costs. Fixes
to test cases.

FossilOrigin-Name: e612664aa2e24ed5e222be2c7fe16e210ac9bded
2013-06-11 01:50:08 +00:00
drh
5822d6feb2 Fix test cases for the new EXPLAIN QUERY PLAN format. Add the
wherecosttest tool.  Other fixes to logarithm cost.

FossilOrigin-Name: aa580e368e3c398b8377b80342dfdd906324c248
2013-06-10 23:30:09 +00:00
drh
6f403ca450 Add a test case contributed on the mailing list
that works in NGQP but fails in legacy.

FossilOrigin-Name: 96afe50866a08ed14e911c3c955030f7ab83a3ed
2013-06-05 12:18:15 +00:00
drh
e353ee3898 Update some variable names and comments in the ORDER BY optimizer. Fix a
bug in the ORDER BY optimizer dealing with IS NULL constraints.  Updates
to test cases.

FossilOrigin-Name: cf96eb5945a9bab71104cb1581ee13ab30022566
2013-06-04 23:40:53 +00:00
drh
aec93a1f2d Test case updates.
FossilOrigin-Name: 0360fec7c093870269211447e9642b5ee34ff778
2013-06-04 15:31:16 +00:00
drh
7699d1c4e5 Refactor the ORDER BY optimizer in the NGQP so that it is easier to maintain
and so that it can support optimizing out GROUP BY and DISTINCT clauses.

FossilOrigin-Name: e605c468e3a1163167831c4a6220825c0b5d083b
2013-06-04 12:42:29 +00:00
drh
7c171098b7 Remove more vestiges of sqlite_query_plan from the test cases.
FossilOrigin-Name: eb27086e8a8a4d5fcb2ea358256a555e34339423
2013-06-03 22:08:20 +00:00
drh
a3855653ed Adjust the xBestIndex methods on both the fuzzer and transitive_closure
virtual tables so that an unused MATCH operator gets a really large cost.
Remove ambiguities from the fuzzer test cases.

FossilOrigin-Name: e2c1af78b65a8ace976fa6c035db212e1ffc79b8
2013-06-03 21:25:28 +00:00
drh
45c154ac90 Pull in recent trunk changes. Fix the ORDER BY optimizer so that it is better
able to deal with COLLATE clauses.  Clean up ambiguities in the descidx1.test
script.

FossilOrigin-Name: 6bc71dfcf0ef757c5c2b426dd8fddc1e5ae0f598
2013-06-03 20:46:35 +00:00
drh
f5ad80397d Fix a typo in a collating function inside the e_reindex.test script.
FossilOrigin-Name: 4d74fccf02134a998a84097b021ba9d501e34ff0
2013-06-03 20:39:15 +00:00
drh
74990dce64 Resolve ambiguities in test cases in collate2.test.
FossilOrigin-Name: dcbbcb2e6c85780276cb3a392549f70e21e94408
2013-06-03 19:01:26 +00:00
drh
d2b113bc33 Fix a bug in the transitive_closure virtual table that NGQP exposes.
Update between.test module to avoid using sqlite_query_plan.

FossilOrigin-Name: aa66b864204b4b8717d845499132b987eb8ef924
2013-06-03 18:50:15 +00:00
drh
d108d74d48 Virtual tables now always report 25 rows instead of 0 rows in the
EXPLAIN QUERY PLAN output.  Adjust tests accordingly.

FossilOrigin-Name: 7d91f688815597ff65ec04b7daa21cb9e5d6bf98
2013-06-03 15:24:11 +00:00
drh
6186b30901 Add test cases to verify that ticket [bc1aea7b725f2761] has been fixed in
the NGQP.

FossilOrigin-Name: 9b97af94ae7b1624ef1f5adee58010593fbb8b1c
2013-06-03 14:15:34 +00:00
drh
ae70cf1816 Allow tracing of whereLoopInsert() when the 0x8 bit is set on ".wheretrace".
Remove the use of sqlite_query_plan from where2.test.  Fix a bug in the
code generator for OR clause optimizations.

FossilOrigin-Name: 707f0323264c35be14847a6adc49a0dc5eaf4ad2
2013-05-31 15:18:46 +00:00
drh
6fa978dade Futher simplifications to the NGQP. Fix some test cases to use
EXPLAIN QUERY PLAN rather than the (now obsolete) sqlite_query_plan
global variable.

FossilOrigin-Name: ae985db4fa08b5efbef5a834e852f0b05101264b
2013-05-30 19:29:19 +00:00
drh
70bdcc738e The expected result in a test case can be of the form "*glob*" or "~*glob*" to
match or not match the GLOB pattern.  This is useful for matching
EXPLAIN QUERY PLAN output that contains regular expression syntax characters
like "?", "(", and ")".

FossilOrigin-Name: a3b4e261bd7e278f150872cce7b020af5ad8d2ed
2013-05-30 19:28:34 +00:00
drh
e1e9766dee Merge recent trunk changes into the NGQP branch.
FossilOrigin-Name: aebe1f2603ee04d792af73aaf59625bda99d5cd1
2013-05-30 11:48:36 +00:00
dan
ba4f01edb3 Add tests for running FTS 'merge' and 'optimize' commands in shared cache mode.
FossilOrigin-Name: 09e5a7ad85dc592fce868a2d0f8719c6915ccb47
2013-05-29 14:22:19 +00:00
drh
def3367e50 Add the percentile() SQL function as a loadable
extension in the ext/misc directory.

FossilOrigin-Name: a64d760d9290b1be78cdda7ae66d4f02c3b3fa53
2013-05-28 20:25:54 +00:00
dan
87ddfeb079 When writing to an FTS table, take an exclusive shared-cache lock on the %_segdir table before writing. Otherwise, an xCommit() call may report an SQLITE_LOCKED error.
FossilOrigin-Name: 3cd2da42e9403b1e6243ad53f3f2bbf89c0fb9b0
2013-05-27 10:11:53 +00:00
drh
7c4ac9860c Merge the latest trunk changes into the NGQP branch.
FossilOrigin-Name: 7c8f992c04504a132686ad0652efdff19e43480d
2013-05-24 13:55:23 +00:00
dan
7a7083cf70 Have the "make fulltest" command run the "mmap" permutation test.
FossilOrigin-Name: 82ad373f85aa0a87d24c6dbb2ea7dca8c5aff56a
2013-05-23 10:15:46 +00:00
drh
34e258c942 Cause the mmap_size PRAGMA to immediately change the mmap space if the
database connection is already active.  In particular, reducing mmap_size
will immediately free up process address space.

FossilOrigin-Name: 761177927cb51e4f5e66061ca39cf37edbe8346b
2013-05-23 01:40:53 +00:00
drh
ef86637655 Use the NGQP plan for EXPLAIN QUERY PLAN output. This change causes 207
errors in veryquick.test, many of which are benign.

FossilOrigin-Name: f783e8e6b10de44029c7c5f57e4648a4a677ca1b
2013-05-22 20:49:02 +00:00
drh
a50ef114f4 Improvements to ORDER BY handling in the NGQP. Fix an "exit" mistakenly
left in a test script during the previous check-in.

FossilOrigin-Name: 12c709b4369c7d94d7fb743d0d0da7a9350a3d16
2013-05-22 02:06:59 +00:00
drh
d15cb17174 Enhanced "wheretrace" output in the NGQP solver routine.
FossilOrigin-Name: 04dfb85a2a7025d4b5056b73fa8477691323919f
2013-05-21 19:23:10 +00:00
dan
cf8489fe2f Add extra "PRAGMA mmap_size = N" statements to mmap1.test and mmap2.test.
FossilOrigin-Name: cec0a06c17435d5a35e76b52d6901ecda98f9916
2013-05-17 12:25:00 +00:00
dan
4c5aeecc90 Fix minor test script issues causing releasetest.tcl to fail.
FossilOrigin-Name: d8ded9d8a1052885ce223c70efa55c0dd8b9920e
2013-05-16 19:15:07 +00:00
dan
5b04dc517a Several releasetest.tcl related fixes to test cases. No code changes.
FossilOrigin-Name: e97d744ba1138e6c4c1fc657c32f4391ea7479f1
2013-05-16 14:28:47 +00:00
dan
617dc8602d In sqlite3_close_v2(), do not attempt to roll back a transaction if there exist active statement objects. Any open transaction will be rolled back when the last of these statement objects is finalized.
FossilOrigin-Name: d11e76072a17fe833b87595d9d79f2c4b0b09cb3
2013-05-16 11:57:28 +00:00
dan
11f71d6ae4 Fixes to allow testfixture to be compiled with SQLITE_OMIT_VIRTUAL_TABLE defined.
FossilOrigin-Name: 00231fb0127960d700de3549e34e82f8ec1b5819
2013-05-15 18:34:17 +00:00
drh
f7d2573d7c Merge the shared-cache-fixes branch into trunk.
FossilOrigin-Name: 5cc1cc55d28a73d390d51fdf6f2c026f1cab1d75
2013-05-15 17:08:46 +00:00
dan
d58792e0f0 Extra test for commit [6dae62c4e5].
FossilOrigin-Name: b10b9e758b171b0f514592bba70c3ecd17c8c47f
2013-05-15 16:24:46 +00:00
drh
2ab2d55f01 Fix the sharedA.test module so that it does not attempt to run TCL callbacks
on a different thread from where the interpreter was originally created.

FossilOrigin-Name: 65ff754e3521aa8ee9135d235166cac2a8f57ebd
2013-05-15 16:08:33 +00:00
dan
d5dd3305a1 Do not run sharedA.test if the system is not threadsafe.
FossilOrigin-Name: d484eaf8d6dfaf2c1065b93b2a52a6db91c09fa4
2013-05-15 15:53:52 +00:00
dan
91cf9ba339 Merge latest trunk changes with this branch.
FossilOrigin-Name: 47dd65a890955f333d431e275f3f4d95d34a5ba5
2013-05-15 15:42:14 +00:00
dan
911ce41818 When loading a database schema that contains an index definition that includes a COLLATE clause for which the collation sequence is unavailable, do not assume that that index uses BINARY instead. Fix for [0fc59f908b].
FossilOrigin-Name: 6dae62c4e505a9a1a22c2771ef3e1921407c4748
2013-05-15 15:16:50 +00:00
dan
6743081784 When closing a connection, avoid tripping active cursors belonging to a different shared-cache client. Also, if sqlite3_close() is called while there are still active statements belonging to the connection, return SQLITE_BUSY and do not roll back any active transaction.
FossilOrigin-Name: 6071b7cce067c807e040283fc4b7449dc6eca498
2013-05-15 10:21:50 +00:00
drh
35cbe7f523 Merge together the fork in this branch.
FossilOrigin-Name: 164e3d4da20cc16d2a04d602b5a8229e0db99d9d
2013-05-14 23:13:41 +00:00
drh
85ec3b63d8 Fix an assert() in unlockBtreeIfUnused() so that it checks for the existance
of an untripped cursor, not for the existance of any cursor at all.

FossilOrigin-Name: a6f851d0fe01d8c8d44a2fe0b716ff7a5194c63b
2013-05-14 23:12:06 +00:00
dan
bf0e57a7d0 Avoid deleting a b-tree "has-content" vector belonging to another shared-cache connection from within sqlite3_close().
FossilOrigin-Name: 93462df78247f5634b9f53752cf80056bbfe9aac
2013-05-14 20:36:31 +00:00
dan
cd7b91a7f1 Candidate fixes for problems revealed by notify2.test. Notify2.test is still failing at this point.
FossilOrigin-Name: ea0428f9b6e63066e7444a2ba2f8c12a2e3ab7e4
2013-05-13 18:23:15 +00:00
drh
b3129fa560 Do not move WHERE clause terms inside OR expressions that are contained
within an ON clause of a LEFT JOIN.  Fix for ticket [f2369304e47167e3e].

FossilOrigin-Name: 1128575d0ab24f7023a0f6e6ce4828b9a09a7c6c
2013-05-09 14:20:11 +00:00
mistachkin
0bf3bc6c64 Refine and reform all Windows OSTRACE macro usage. Replace all usage of sqlite3TestErrorName() with sqlite3ErrName() and add missing return codes.
FossilOrigin-Name: 610425f19008b8b5d4bf027c8b14d97ec3115a54
2013-05-09 00:40:13 +00:00
drh
c01b7306ae Make sure the ORDER BY collating sequences are compatible with the
comparison collations before using the merge algorithm for compound
SELECT statements.  Candidate fix for ticket [6709574d2a8d8].

FossilOrigin-Name: fc3630cdef6e2cdbfb4e7b373d1a094753e55016
2013-05-07 17:49:08 +00:00
dan
e8dee7d1ed Modify the fts3tokenize table implementation so that it does not use the SQL function fts3_tokenizer. The user may have installed an authorizer callback that prohibits this.
FossilOrigin-Name: 0ba67b64de258883e4c43db09e131bb67083855e
2013-05-07 12:16:48 +00:00
drh
2722898c6c Make sure the authorizer callback gets a valid pointer to "ROWID" for the
column-name parameter when doing an UPDATE that changes the rowid.
Fix for ticket [0eb70d77cb05bb2272].

FossilOrigin-Name: 26a59bb88d4082758eb281b365b57f9a0c059d89
2013-05-06 13:22:50 +00:00
drh
4ee09b4bcc Allocate 4 bytes of unused header space for an "Application ID". Add
the "PRAGMA application_id" command to set and query this identifier.
Add the "magic.txt" file to show how the posix file command might use
this application id.

FossilOrigin-Name: 28c9e7fdee2471a3026ee05ff591194d5f398131
2013-05-01 19:49:27 +00:00