Commit Graph

11399 Commits

Author SHA1 Message Date
drh
89a75397e0 Add test cases to cover TPC-H Q8.
FossilOrigin-Name: eb5cef8351d12c0f8550dac96ee7a6e495975b5a
2013-09-11 14:57:11 +00:00
drh
09328c00d6 Additional unlikely() test cases. Logic tweaks to support test coverage.
FossilOrigin-Name: 5d00cce74a7aefaf30022ae971ab1e0451e0ad6e
2013-09-11 14:34:58 +00:00
drh
aae0f9e462 Change the name of the two-argument unlikely() function to likelihood().
Add test cases.

FossilOrigin-Name: 29a359b8d7f90e6fa2b28ce2a112284fd3870494
2013-09-11 11:38:58 +00:00
drh
abfa6d52ed Tweaks to the index selection logic.
FossilOrigin-Name: 52d52688644f635a50a60ff17b160f3affa8fa6c
2013-09-11 03:53:22 +00:00
drh
36fabb6297 Merge trunk fixes into the unlikely-func branch.
FossilOrigin-Name: a51d751553b14aa26912c516f60727551deb8e60
2013-09-10 01:53:18 +00:00
drh
1d2b3c1f8a Deterministically initialize the PRNG used as a tie-breaker in the ANALYZE
command, so that the analysis is always the same given the same database.
This simplifies testing.

FossilOrigin-Name: 48ed8b565b84c8fa7898c2f9817c01f7e9c9182e
2013-09-10 01:41:25 +00:00
drh
0259bc3da2 Make sure that the transitive constraint optimization does not cause
WHERE clause terms to be disabled prematurely.  We are unable to find a test
case that fails because of this, but it seems prudent to make this
preventative change nevertheless.

FossilOrigin-Name: d6e361d7fb8013d616af91ef2c10038c97d1be5f
2013-09-09 19:37:46 +00:00
drh
add5ce303f Continuing refinements of the logic to take WHERE clause terms not used for
indexing into account when computing the number of output rows from each
table.

FossilOrigin-Name: b65dc53415f42d8402d0ec7f4bedf59d7b39b486
2013-09-07 00:29:06 +00:00
drh
fde1e6bc37 Enhance the plan solver to take into account the number of output rows when
computing the set of paths to retain for the next cycle.

FossilOrigin-Name: 1a46a7242313da96420985fa52e1de3f84533e5b
2013-09-06 17:45:42 +00:00
drh
cca9f3d291 Initial implementation of the unlikely() SQL function used as a hint to
the query planner.

FossilOrigin-Name: 036fc37a034093a4c6fc190633bd41c2b7230d77
2013-09-06 15:23:29 +00:00
drh
d36e104112 Combine the FuncDef.iPrefEnc and FuncDef.flags fields into a single
new FuncDef.funcFlags field.

FossilOrigin-Name: 97b10e66e98e84755aa577f8da017bf1aea2056c
2013-09-06 13:10:12 +00:00
drh
0d31dc37ac Make sure the destination WhereLoop is left in a sane state when an
OOM fault occurs inside of whereLoopXfer().

FossilOrigin-Name: a99a53b81e29c9514b85318bea028d1667e5f760
2013-09-06 00:40:59 +00:00
dan
8ff2d9561a When preparing an UPDATE statement, avoid generating VDBE code for those foreign key related actions and constraint checks that may be seen to be unnecessary by considering the subset of table columns potentially modified by the UPDATE.
FossilOrigin-Name: e940b5de49baa1d6a4cf859fbbc0e0df86ac5dbf
2013-09-05 18:40:29 +00:00
drh
74dade2155 Rearrange the order of conditions in an "if" statement to facilitate testing.
FossilOrigin-Name: 8462fb43c275a70db59c4339650225deeadeef00
2013-09-04 18:14:53 +00:00
dan
af0d8bcf4b Add tests to improve coverage when SQLITE_ENABLE_STAT3 is defined.
FossilOrigin-Name: f929e9b41f2f69b086be3dd48fe557adbba7ae5c
2013-09-04 16:38:42 +00:00
drh
55a1b30875 Fix a bug in the command-line shell for ".mode insert" on UTF16 databases
with BLOB values.

FossilOrigin-Name: d8fdc7821808e2bfa048144ee3015b745232dc30
2013-09-04 16:08:50 +00:00
drh
2b1a64a120 The sqlite3Stat4ProbeSetValue() routine should always return results using
the database encoding.

FossilOrigin-Name: eb21663271369c3862bc8fd800f76d568c8579fe
2013-09-04 15:15:10 +00:00
mistachkin
c2cfb51525 Fix out-of-order variable declaration. Fix harmless compiler warning.
FossilOrigin-Name: 8df95bb0b3f72222cf262174247a467c234f9939
2013-09-04 04:04:08 +00:00
drh
30f07042df Conditionally exclude code from analyze.c that is not used by STAT3.
FossilOrigin-Name: a48948a170056dfb87541dd5eb2773094dec6f8a
2013-09-04 02:07:38 +00:00
drh
fbc38de980 Harden the STAT4 logic in where.c against OOM faults.
FossilOrigin-Name: 91d2cfbc95c34c0040deb69106bb9f895abb94c0
2013-09-03 19:26:22 +00:00
dan
b13af4c5dd Fix another problem in stat4 sample selection.
FossilOrigin-Name: d59f580904e6e7e90fc0a692a3dd4eeff5942479
2013-09-03 14:43:12 +00:00
drh
67a5ec7b54 Make sure the omit-noop-left-join optimization is not applied if columns
of the LEFT JOIN are used in the ORDER BY clause.  
Ticket [be84e357c035]

FossilOrigin-Name: 0303d6bc7112e6f810ae1bd75cafc5ffc51f5212
2013-09-03 14:03:47 +00:00
drh
05db3c7743 Simplify branch coverage testing by interchanging the order of two tests
in the whereLoopInsert() function.

FossilOrigin-Name: f7079b5365dd6cd8324a4fb23605e81476122ed6
2013-09-02 20:22:18 +00:00
dan
b49d1047c6 Further stat4 related tests.
FossilOrigin-Name: 0a702c4b4c35fdbcb62e3ab88b9e57d7ea0052a8
2013-09-02 18:58:11 +00:00
dan
84f48296fa Add tests to check if ANALYZE is choosing common non-periodic samples for the stat4 table.
FossilOrigin-Name: 175842997af134138784bff6f8e93573deb5b36b
2013-09-02 11:52:11 +00:00
dan
575ab2f8f6 Fix a problem with using stat4 data to estimate the number of rows scanned by a range constraint on the second or subsequent column of any index where an affinity transformation must be applied to the constraint argument.
FossilOrigin-Name: c21f58d84859e479a6cc619671a0df48b2f9692e
2013-09-02 07:16:40 +00:00
drh
1df556e6f2 Cleanup of the windows VFS, including added support for Cygwin, fixes
for compiler warnings under unusual configurations, and improved diagnostic
error messages.

FossilOrigin-Name: c94933f13208f3f7d6d1b117ce6d2821100655a4
2013-08-31 18:36:14 +00:00
mistachkin
1a88b14e5d Revise the amalgamation tool to allow 'duplicate' include files to be retained manually while still preserving the existing line numbers.
FossilOrigin-Name: aa48284637b954d63bcf77e19b25e75c7ad1a6d3
2013-08-31 18:06:52 +00:00
dan
4a1aa3851a Fix a problem causing SQLite not to use stat4 or stat3 data to analyze constraints of the form "column = expr COLLATE collation" (those with an explicit COLLATE on the non-column side of the comparison operator).
FossilOrigin-Name: 1e86d81d46c9da6aaee0c6938ee40933f35e3d0d
2013-08-31 17:21:26 +00:00
mistachkin
28159a5ee9 Enhancements to the Win32 API definition macros.
FossilOrigin-Name: b1811baab6e35ecb1ba920a7ed3302997758d309
2013-08-31 17:01:56 +00:00
dan
3fa2a82b8b Reenable a test accidentally disabled when the stat4 branch was merged.
FossilOrigin-Name: d9fadc8fa6ef02d516678d57896d93e0a5f52cfe
2013-08-31 14:56:30 +00:00
mistachkin
2a43c28f06 Avoid commenting out #include statements when building the amalgamation source code file.
FossilOrigin-Name: 2fca6d784b000fd3a4d6890e38a0b087767f3a7f
2013-08-31 05:46:42 +00:00
mistachkin
3fb4b6df07 Fix harmless MSVC compiler warning with MEMDEBUG defined.
FossilOrigin-Name: b48cfd2dfca70091a52deeeee16619237e1c270b
2013-08-31 05:13:22 +00:00
mistachkin
9f11ef1232 Improve the consistency of the diagnostic messages on Windows.
FossilOrigin-Name: c6f174a0cb27fe79740fffc7ce51081ec52a5dbd
2013-08-31 02:48:56 +00:00
mistachkin
d95a3d3527 Add support for Cygwin when handling temporary file names. Improve error codes and diagnostic messages for temporary file name handling on Windows. Rename winConvertUtf8Filename to winConvertFromUtf8Filename. Improve placement and comments for forward function declarations.
FossilOrigin-Name: a411df725153119acb3bcf44fb71deecaa307887
2013-08-30 21:52:38 +00:00
dan
ad4c7aa10f Fix compiler warnings in analyze.c.
FossilOrigin-Name: 5bbd2ccb3d2d6286fd667dac2ab658d6b89640a6
2013-08-30 20:19:52 +00:00
mistachkin
79e8445f63 Fix comment typo in analyze.c. No changes to code.
FossilOrigin-Name: dbc31750440226702fbf88f1bf6140ef403c9be1
2013-08-30 19:59:48 +00:00
drh
e56dd3ad7b Fix comment typos in the where.c module. No code changes.
FossilOrigin-Name: 1e0b77cf0edf3d26f76d83aa5466e9ec0e60a710
2013-08-30 17:50:35 +00:00
drh
f46af73720 If the cost of two whereLoop objects is the same in every way except that
one has fewer expected output rows than the other, then choose the one with
fewer output rows.

FossilOrigin-Name: 79e458ef7acfddbc189163e3e958da529becb130
2013-08-30 17:35:44 +00:00
drh
77a3fdc1b0 Add the SQLITE_MINIMUM_FILE_DESCRIPTOR compile-time option, for control over
exactly which low-numbered file descriptors SQLite will use.

FossilOrigin-Name: ba5190534330a25722eeb7ea9c42da7a6d146014
2013-08-30 14:24:12 +00:00
dan
43398081a8 Add a test for fts4 unicode61 option remove_diacritics=0.
FossilOrigin-Name: 6bf7ae6ff6b18712544ddeafb6848b3b27ff22d2
2013-08-30 13:29:51 +00:00
drh
5128d009c6 Improvements to the robust_open() logic in the unix VFS so that if an attempt
is made to open a repository on file descriptors 0, 1, or 2, and blocking
that file descriptor by opening it on /dev/null fails, then the open will
fail.

FossilOrigin-Name: d9c018f8155ab48df8e0e02519bba50588fe49fc
2013-08-30 06:20:23 +00:00
drh
00ea0e1133 Make the unix VFS defensive against the error of having a database file open
on file descriptors 1 or 2, as an error message might easily be written onto
those file descriptors and thus overwrite and corrupt the database.

FossilOrigin-Name: 30d38cc44904d93508b87e373b2f45d5f93e556b
2013-08-29 23:36:49 +00:00
drh
35a0379a05 Change the unix VFS so that it refuses to open a database file using
a file descriptor less than 3.

FossilOrigin-Name: 66dddda06898abbf97fe0ac6a10ce1527ca8605e
2013-08-29 23:34:53 +00:00
drh
0c9a8e345e Never leave an open file descriptor pointing into the middle of the
database file if the file descriptor number is 2 or less.

FossilOrigin-Name: 3426673e4659eb68dbd14a3e41d4620d748432db
2013-08-29 21:26:26 +00:00
dan
8bff07a55f Restore fix [f15591f802], which was accidentally clobbered by the stat4 merge.
FossilOrigin-Name: d4b6ad3333cc3bad500c2ebf7a6ea552b6762b69
2013-08-29 14:56:14 +00:00
dan
cd40abb297 Candidate fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns.
FossilOrigin-Name: c1152bdcbb5ac185f743015fff63769effa81b4b
2013-08-29 10:46:05 +00:00
mistachkin
1d406e0dfd Small enhancements to unit testing infrastructure.
FossilOrigin-Name: 9229aeb361f9805894321327d05aba855b8799f3
2013-08-29 01:09:14 +00:00
mistachkin
8bcd3fa75a Enable finer control of optimizations when compiling with the MSVC makefile. Also, several modularity enhancements to the MSVC makefile.
FossilOrigin-Name: 6c709338bc77fbed24a2597eabd88dd8c29b38d7
2013-08-29 01:03:38 +00:00
dan
1d2b70e3d2 Re-enable test file wild001.test.
FossilOrigin-Name: 4f182ddc36944fa54f1a34c1f0527db0ebb39c96
2013-08-28 19:01:07 +00:00