Commit Graph

11399 Commits

Author SHA1 Message Date
dan
290703091e Add some extra assert() statements to silence a few clang warnings.
FossilOrigin-Name: 1c63e9515b5f5cb9169928b108d002dcd18ad4fd
2013-08-19 18:17:03 +00:00
drh
4ccc419b3c Remove unused variables from the command-line shell sources.
FossilOrigin-Name: 753a402e90f3c9f675155ea96ee048dbe7a68700
2013-08-19 14:23:31 +00:00
drh
9e48788e9d Fix a potential reference off the end of an array in the query planner.
FossilOrigin-Name: f15591f80212dd6d4ed8e0f14be691cd578d4cdf
2013-08-19 14:19:00 +00:00
drh
77dfd5bb44 Fixes for harmless compiler warnings.
FossilOrigin-Name: a0d9ca4f07f1dc3a189864f8ed9cdb0b1d791b1a
2013-08-19 11:15:48 +00:00
drh
92707acfd0 Adjustments to #ifdefs in analyze.c to all a clean compile with no
extra code with both ENABLE_STAT3 and ENABLE_STAT4 and with neither.

FossilOrigin-Name: f86b75b6c7290ee6ddb3636090b00e99fc68c45e
2013-08-17 18:57:15 +00:00
drh
45e3215db0 Add the cache_spill pragma. Change the fullfsync and checkpoint_fullfsync
pragmas to apply to all attached databases.

FossilOrigin-Name: 65a85a156f3c827890e9f1fd22484a2f875c3b6f
2013-08-17 16:37:04 +00:00
drh
d3605a4f20 The fullfsync, checkpoint_fullfsync, and cache_spill pragmas apply to all
files of a database connection, including those opened by future ATTACH
statements.

FossilOrigin-Name: d07c4331a28d44deca1ece8a34118f5b121b3ee2
2013-08-17 15:42:29 +00:00
drh
d4b5c60eca Test cases for the cache_spill pragma.
FossilOrigin-Name: b85c9ec5e02c1b92faa8eeb9e56e02a576a43a96
2013-08-17 00:25:07 +00:00
drh
40c3941cfa Add the cache_spill pragma.
FossilOrigin-Name: cdb181c04fa99c6c29f23eb68ccb5475e7f6bf9c
2013-08-16 20:42:20 +00:00
dan
0e8194a9c7 Add a test for the problem fixed by [91733bc485].
FossilOrigin-Name: 5c591104813a7e55e59f4f557cbb3e500fa817c2
2013-08-16 17:46:49 +00:00
drh
202ca9075f In sqlite3Stat4ProbeSetValue() change a local variable name iVar to iBindVar
to avoid confusion with iVal, and fix a place where the name was actually
confused.

FossilOrigin-Name: 91733bc4856034c10bc2ba0acdae1970b05d62b9
2013-08-16 17:18:02 +00:00
drh
cf9f83dca2 Merge the fork that resulted from a check-in race.
FossilOrigin-Name: b7fe4f362bdf7b233a7b09eb9ce16d296165f82a
2013-08-16 14:51:32 +00:00
drh
0e1f0029c0 Fix valueFromExpr() so that it returns SQLITE_NOMEM following an OOM when
changing text encodings.  Also fix some asserts to accommodate OOM errors.

FossilOrigin-Name: dc1ccd09c443cebc4731dbe1a0dea84a9ccf6a9b
2013-08-16 14:49:00 +00:00
dan
22d73b1cbe Fixes for test code that was not working with utf16 databases. Run the analyze*.test scripts as part of the 'utf16' permutation test.
FossilOrigin-Name: fe99494d99df95f699ffab07b1e212800b5ff00d
2013-08-16 14:48:23 +00:00
dan
585c823256 Add extra tests. No code changes.
FossilOrigin-Name: 949127d53e0a907ed6f73c6828637d94b265468c
2013-08-16 14:23:02 +00:00
dan
c367d4c052 Avoid buffer overreads and false OOM error reports that could be caused by corrupted sample records in the sqlite_stat4 table.
FossilOrigin-Name: 9f85b6a52a0b9b1524daa6f24d85257e7f591e95
2013-08-16 14:09:43 +00:00
drh
61b3440603 Fix a potential segfault following an OOM while running ANALYZE.
FossilOrigin-Name: 0118797823c9093e68113578f3f3aae65de41453
2013-08-16 13:34:50 +00:00
drh
d94f512f58 Merge recent trunk changes into the STAT4 branch.
FossilOrigin-Name: c69b512af276a438399747af22659415af3a5d4d
2013-08-16 12:26:33 +00:00
drh
0af16ab2c2 Make sure that GROUP BY terms select input column names in preference to
output column names, in compliance with the SQL standard.
Ticket [1c69be2dafc28].

FossilOrigin-Name: f2d175f975cd0be63425424ec322a98fb650019e
2013-08-15 22:40:21 +00:00
drh
e35463b312 Bare identifiers in ORDER BY clauses bind more tightly to output column name,
but identifiers in expressions bind more tightly to input column names.
This is a compromise between SQL92 and SQL99 behavior and is what
PostgreSQL and MS-SQL do.  Ticket [f617ea3125e9c].

FossilOrigin-Name: c78b357c00a35ed48ce2ffbc041de8d22570d1e2
2013-08-15 20:24:27 +00:00
mistachkin
fc7df53aee Make it easy to attach a debugger the test fixture process prior to any tests being run.
FossilOrigin-Name: 53cd9ebfaf401c7932bf591e134a527c9962b88e
2013-08-15 20:05:03 +00:00
dan
0adbed8a60 Fix a crash that can occur if the sqlite_stat3 or sqlite_stat4 table is corrupt.
FossilOrigin-Name: d51df8a8fcc31c37f6e1c9612204af5738ed865e
2013-08-15 19:56:32 +00:00
dan
af2583c83c Fix a crash that can occur following an OOM fault.
FossilOrigin-Name: 9f80b2687012ab7c4d6d654fe19f40878bd78bd8
2013-08-15 18:43:21 +00:00
dan
3bc9f74fe9 Change some assert() statements in vdbe.c to ensure that a memory cell used to store a VdbeCursor object is not also used for some other purpose.
FossilOrigin-Name: 71070c9fce86103f174220e07771df99b2e01405
2013-08-15 16:18:39 +00:00
drh
f0459fc410 Make sure the ANALYZE command allocates enough VDBE registers.
FossilOrigin-Name: 46fec9b1a1c4616df5a634dbf9235bd13408d3a9
2013-08-15 16:15:00 +00:00
dan
1f616ad8fa Add tests for sqlite_stat4 sample selection. And a fix for the same.
FossilOrigin-Name: 1fb4d9d6f2675515feb8e3d971bbd54716372549
2013-08-15 14:39:09 +00:00
drh
26080d9241 Clarification and typo fixes in comments related to name resolution.
No changes to code.

FossilOrigin-Name: f30abdf9d814d6c75bf1c803054737c737ad636f
2013-08-15 14:27:42 +00:00
mistachkin
1f28e0703f Make it easy to attach a debugger the test fixture process prior to any tests being run.
FossilOrigin-Name: c23acba11bfefc019b5945cfb345f9afcf4b6242
2013-08-15 08:06:15 +00:00
dan
f00e902580 Change the way ANALYZE works to use a single cursor when scanning indices.
FossilOrigin-Name: bdce612b35193abf72de1a563ea7962375b3574e
2013-08-14 19:54:12 +00:00
mistachkin
3dfaf6766c Fix a few more minor comment typos. No changes to code.
FossilOrigin-Name: 9e999081a59b161a0a1f968fbc01a1db9ea43b93
2013-08-14 00:20:23 +00:00
mistachkin
037933b8a7 Fix an outdated comment and a comment typo. No changes to code.
FossilOrigin-Name: ac336959490083ffeaaf25aaec97ecb59a2f4536
2013-08-13 22:33:41 +00:00
dan
8ad169abb4 If ENABLE_STAT3 is defined but ENABLE_STAT4 is not, have ANALYZE create and populate the sqlite_stat3 table instead of sqlite_stat4.
FossilOrigin-Name: cca8bf4372ab7a0258aa5c9397818415c6cf0abf
2013-08-12 20:14:04 +00:00
dan
86f69d98d2 If there is data in both the sqlite_stat4 and sqlite_stat3 tables for a single index, ignore the sqlite_stat3 records.
FossilOrigin-Name: 2a41736728d83a777ea8112da927cb047ec6684e
2013-08-12 17:31:32 +00:00
drh
6b0ae91930 Handle a NULL input to decodeIntArray() that can result from a prior OOM.
FossilOrigin-Name: fa1588adab6759fd3d1be02524aa19a0d1c6adaa
2013-08-12 17:00:08 +00:00
dan
0106e378f1 Re-enable reading from the sqlite_stat3 table (as well as sqlite_stat4).
FossilOrigin-Name: 6d45078e621526fc2bac0eaefbb0f9602b9a8ec5
2013-08-12 16:34:32 +00:00
dan
5133c78cae Fix a bug in calculating the average number of entries for keys not present in the sqlite_stat4 table.
FossilOrigin-Name: ec3ffb174844406a6186c3dcc41b76d0331b502c
2013-08-12 11:21:10 +00:00
dan
568cd51b79 Fix minor problems caused by adding the rowid to the records in stat4.
FossilOrigin-Name: 088d1ff94890ada50d43e6a366a58167ec5a8e96
2013-08-12 09:29:04 +00:00
dan
dd6e1f193e Add the rowid field to the end of sample records stored in the sqlite_stat4 table.
FossilOrigin-Name: 3a5e8ab7ddbe1d943b35ef329fe4e5a1bfdb0d9d
2013-08-10 19:08:30 +00:00
dan
84d4fcc52d Fix a couple of typos in a comment in analyze.c. No code changes.
FossilOrigin-Name: 5bcccb93df98f5dfee0ea4d797b07fe0257258a9
2013-08-09 19:04:07 +00:00
drh
c8af850479 Update the header comment on analyze.c to describe the sqlite_stat4 table
format.

FossilOrigin-Name: 4d97809d6b29809f12d753043bda1976bdb1bd3b
2013-08-09 14:07:55 +00:00
dan
b3c02e210f Fix problems in estimating the number of rows visited by a range query using sqlite_stat4 data when the column subject to the range query is not the leftmost of the index.
FossilOrigin-Name: 9228aaf54dd2700c4f460f94f9c2309407578983
2013-08-08 19:38:40 +00:00
dan
84c309b6ae Use a binary search instead of a linear scan when comparing a sample key against data from the sqlite_stat4 table.
FossilOrigin-Name: e50dc30523210ba12324d5d8379503610f13aa34
2013-08-08 16:17:12 +00:00
drh
ab80be99e3 If the SQLITE_EXTRA_INIT function is defined, make sure it is called only
once by the effective sqlite3_initialize() call.

FossilOrigin-Name: e2b597cafe7c8a8313b051d6a302fed54f235727
2013-08-08 14:38:45 +00:00
dan
ad45ed7414 Fix a segfault in "ALTER TABLE t1 ADD COLUMN b DEFAULT (-+1)". Also an assert() failure that could occur if SQLITE_ENABLE_STAT4 were not defined.
FossilOrigin-Name: 9fec3e38287067d60874530300fbeb602958c951
2013-08-08 12:21:32 +00:00
dan
6cb8d76ccb Fix a bug in using stat4 data to estimate the number of rows selected by a range constraint.
FossilOrigin-Name: f783938ea999731ea073cd2c78e278095f7bea6d
2013-08-08 11:48:57 +00:00
drh
869c0409e3 If the SQLITE_ALLOW_URI_AUTHORITY compile-time option is set, then allow
non-localhost authorities on URI filenames and pass them through as a UNC
to the underlying VFS.

FossilOrigin-Name: 3adb6c1bfda897859dc9cf9ae7f1e6719855ee68
2013-08-07 23:15:52 +00:00
dan
eea568d68e Replace variable Index.avgEq (average number of rows in keys for which there is no sample in sqlite_stat4) with vector Index.aAvgEq.
FossilOrigin-Name: 7b70b419c43b2c3b2daf11d833a1d60245bfaef5
2013-08-07 19:46:15 +00:00
dan
3d40759803 Merge latest trunk changes with this branch.
FossilOrigin-Name: 08f74c45ecf711a2373af578d44470add9082377
2013-08-07 18:42:27 +00:00
dan
32c693a6e6 Fix typos in a comment in analyze.c. No code changes.
FossilOrigin-Name: 812ed0c58fc5f729a2d4f16775fad6724cc367a6
2013-08-07 16:38:33 +00:00
dan
1f28eaddc4 Change the way samples for the sqlite_stat4 table are collected.
FossilOrigin-Name: 13ed5ac13562e7a39905d70fd47059f4d8001bba
2013-08-07 16:15:32 +00:00