Commit Graph

11144 Commits

Author SHA1 Message Date
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
drh
7ed103210d Fix the ".dump" command on the command-line shell so that it works for
"sqlite_stat4" in addition to "sqlite_stat1".

FossilOrigin-Name: 1e80c4b12dbb5beab422e2a33a8782ac9d767321
2013-08-07 16:04:27 +00:00
drh
4bfd4ad9a7 Remove the unused sqlite3Utf8to16() utility function.
FossilOrigin-Name: 9159b43eb2cb5d6ed18a5ad168fa27134fec2553
2013-08-07 15:57:24 +00:00
dan
87cd93215e When estimating the number of rows scanned using data from the sqlite_stat4 table, avoid allocating UnpackedRecord and KeyInfo structures until they are definitely required.
FossilOrigin-Name: 353950a5269fa439cc3e57b62e16558a84ea2557
2013-08-07 15:52:41 +00:00
drh
3b449ee481 Add a guard #ifndef to test_intarray.h to prevent harm if it is #included
more than once.  Add a comment on the closing #endif of the guards on
sqlite3.h and test_multiplex.h.

FossilOrigin-Name: 0ad83ceb79767738bd06a28840cf84da0464ab4f
2013-08-07 14:18:45 +00:00
drh
4a6fc3596b Fix typos and add clarification to comments in where.c. No code changes.
FossilOrigin-Name: f8d8790ede0fcaf6c5b60ac22919c1d97c74e838
2013-08-07 01:18:38 +00:00
dan
ddc2d6e8f5 Fixes for builds without SQLITE_ENABLE_STAT4.
FossilOrigin-Name: 84999e27cc0d14b89d9fe024e29d287c69285369
2013-08-06 20:15:06 +00:00
dan
7a4192358a When possible, use the multi-column samples in sqlite_stat4 to estimate the number of index rows scanned by a query plan.
FossilOrigin-Name: 2973f5ca736c4a6f13c653d54b6a29d7cae8d0ed
2013-08-06 20:01:43 +00:00
drh
9fe809c561 Fix a test case related to partial indices so that it works even if
STAT3 is disabled.

FossilOrigin-Name: 153c645025637bbff14dfce793e4b92210ded7e8
2013-08-06 19:18:17 +00:00
drh
d3f4964168 Adjust #ifdefs in test_autoext.c so that it compiles with
SQLITE_OMIT_LOAD_EXTENSION.  Fix compiler warnings in two other
test modules.  No changes to the core.

FossilOrigin-Name: 89930ea3c3b3bd078f641b2c5203d851083bbf1a
2013-08-06 18:35:31 +00:00
drh
d9b8c0d761 Update the configure script to use the latest version number (3.8.0).
FossilOrigin-Name: 52e8ec5e24730efa6d89cbaf1e03bc1d5c59cc05
2013-08-06 18:21:21 +00:00
drh
812ea83343 Add a testcase() macro to verify OOM coverage.
FossilOrigin-Name: d43dcbc488120aeb7104ab9e6a27f62bb348bf6a
2013-08-06 17:24:23 +00:00
drh
3535ec3e10 Remove unreachable branches in expr.c, replacing them with assert() and
testcase() statements.

FossilOrigin-Name: 9103c27ceb3f4023ea3a41b679a10717d3f80210
2013-08-06 16:56:44 +00:00
drh
2d463113f0 For the ".import" command of the command-line shell, start a transaction
if there is not one active already.

FossilOrigin-Name: 5dcc2d91bd343cd0fac79d3c8f079a5ce534cdf7
2013-08-06 14:36:36 +00:00
drh
9f099fd45a Clean up the input reader in the command-line shell for improved legibility
and performance.

FossilOrigin-Name: 2b1743d60171635c1e5a6ede6b4928f4671f948d
2013-08-06 14:01:46 +00:00
drh
8c8a8c4573 More than double the speed of the resolveP2Values() routine in vdbeaux.c by
moving from an extended if-else on every opcode to a switch.  Opcodes are
reordered in mkopcodesh.awk to put the switched opcodes close together,
for additional performance and to reduce code footprint.

FossilOrigin-Name: 924f7e4d7a8fa2fe9100836663f3733b6e1a9084
2013-08-06 07:45:08 +00:00
drh
d58d3278cb Performance optimization: Avoid calling convertCompoundSelecctToSubquery()
on queries that do not use the UNION, EXCEPT, or INTERSECT operators.

FossilOrigin-Name: c589b2fed7beabc2337d701094c22635914d9c23
2013-08-05 22:05:02 +00:00
mistachkin
f3d2aaeca2 For the vtshim module, always zero out the xChildDestroy function pointer after calling it.
FossilOrigin-Name: 240f7252c66ad3ff5ae0ef06455c1ff9bd78bbb4
2013-08-05 21:54:17 +00:00
drh
323df7907e Factor all KeyInfo object allocations into a single function:
sqlite3KeyInfoAlloc().  Always allocate enough space so that 
sqlite3VdbeRecordCompare() can avoid checking boundaries and hence
run faster.

FossilOrigin-Name: 7301bedd94c8610568349953b18ff3575203e1b2
2013-08-05 19:11:29 +00:00
dan
c612970c9d Modify the vdbe code generated by ANALYZE to use fewer memory cells and cursor slots.
FossilOrigin-Name: 4a51cf289fad8aebc637b5f96488de18e861195d
2013-08-05 19:04:07 +00:00
dan
e043201d3d Use N separate cursors when scanning an index with N columns to collect sqlite_stat4 data. This fixes a problem with collecting incorrect nEq values from multi-column indexes.
FossilOrigin-Name: 3a71afe67418ce00097cd9714c395fe9ff16f23b
2013-08-05 18:00:56 +00:00
drh
af5b2af77d Improve performance of sqlite3VdbeRecordCompare() by using an approximation
that might give false negatives and only running the more expensive exact 
subexpression if the approximation fails.

FossilOrigin-Name: 28979dcd16f53e0ddca8eed74b668834e2856f03
2013-08-05 15:32:09 +00:00
drh
407ceeb84d Add a missing '#include "tcl.h"' to test_rtree.c.
FossilOrigin-Name: 4b8b426f10f8ae13bf553f7adf5ae09383fa0bd4
2013-08-05 12:31:41 +00:00
dan
c55521a60b Fix a couple of problems in code related to sqlite_stat4.
FossilOrigin-Name: badd24d987240db5528b37d1c177431617079f9b
2013-08-05 05:34:30 +00:00
dan
f52bb8d385 Begin adding experimental sqlite_stat4 table. This commit is buggy.
FossilOrigin-Name: 2beea303a1d609cd2ff252412c50b966b9e5e8f1
2013-08-03 20:24:58 +00:00
drh
3975974780 Updates to requirements marks. No code changes.
FossilOrigin-Name: 213020769f310aec1591d97756b53891d0b64005
2013-08-02 23:40:45 +00:00
drh
e0c7efd9ae Add NEVER() and ALWAYS() macros on some unreachable yet prudent branches.
FossilOrigin-Name: c5c0a8ab6c222185d5f9d4321e64d9f93cd36b7d
2013-08-02 20:11:19 +00:00
drh
b47e07f1c1 Add support for partial indices.
FossilOrigin-Name: 478113f18b1d28606b107b5a0bed04cb90a82cf2
2013-08-02 16:41:02 +00:00
drh
1e7d43c977 Silently ignore database name qualifiers in CHECK constraints and in
partial index WHERE clauses.

FossilOrigin-Name: 2e8c845eb5011a2743dace333aa38383588f2080
2013-08-02 14:18:18 +00:00
drh
0b22101b2f Fix typos in documentation for SQLITE_DBSTATUS_DEFERRED_FKS .
No changes to code.

FossilOrigin-Name: f3efbfcd515ad6ac833f4b26391dcc44603a96e8
2013-08-02 13:31:31 +00:00
drh
989b116a03 Fix the CREATE INDEX statement so that trying to create a TEMP index on
a non-TEMP table throws an error rather than segfaulting.

FossilOrigin-Name: e3c8935f8736d00dc83644fa21d86ca7fec6d2fc
2013-08-01 22:27:26 +00:00
drh
af4300636a Fix an incorrect expected result in a test case in corruptG.test.
FossilOrigin-Name: 6913831ad2892fdc8331ee53426d935386eacb9e
2013-08-01 22:26:56 +00:00
drh
f5601cac4d Fix a potential buffer overread in sqlite3VdbeRecordCompare() when a
serial_type specifies a field that starts in bounds but is much too large
for the allocated buffer.  Mostly harmless.  The overread is unlikely to
go more than one or two bytes past the end of the buffer.

FossilOrigin-Name: e436b2f4e5c5e6b2f70e65332c0c7d618e2ef20a
2013-08-01 20:26:04 +00:00
drh
df003d61ce Make sure signed integer overflow does not cause a segfault while attempting
to read a corrupt database where the header size varint on a record is larger
than the maximum 32-bit signed integer.

FossilOrigin-Name: c3baca99f4580652afb2c3f73036ab83796a1557
2013-08-01 19:17:39 +00:00
dan
2acbc0dd78 Add test case for the problem fixed by [127a5b776d].
FossilOrigin-Name: 65816718b59b286c11d939235a23c7325f25594b
2013-08-01 17:43:35 +00:00
drh
828463375c An improved method for avoiding the use of the STAT3 samples to compute
the estimated number of outputs when the left-most index is equality
constrained.  This check-in undoes the previous fix and applies a new one.

FossilOrigin-Name: 127a5b776d16e1e23c5b3d454f6aaea67f1ded3a
2013-08-01 17:21:26 +00:00
drh
788482c745 Avoid using left-most column STAT3 samples if the left-most column has an
equality constrain and there are inequality constraints on the second column.

FossilOrigin-Name: 31b4e63b3c30fcad22340d84d6076a306f26b49e
2013-08-01 16:52:50 +00:00
drh
3bf0ac1709 Fix bug in the logic that determines the end of a CREATE INDEX statement.
Added a VACUUM test case that exposed the bug.

FossilOrigin-Name: 2e3df0bc900c01286d3ce32c2bbf9e5293973f9b
2013-08-01 16:02:40 +00:00
drh
66518ca71f More test cases and corresponding bug fixes.
FossilOrigin-Name: 0c8cfdfae215c95cf167f404a1d346690b28e972
2013-08-01 15:09:57 +00:00
drh
619a1305e7 Fill out an initial implementation of the sqlite3ExprImpliesExpr() function.
FossilOrigin-Name: 8e07aa2ad5579aeb82174ce5bd432ddb9c058bc1
2013-08-01 13:04:46 +00:00
drh
cf0fd4a5fd Refactor internal function name sqlite3VdbeGetValue() to
sqlite3VdbeGetBoundValue().

FossilOrigin-Name: 81834c3023876487a1188390aae850cf71683701
2013-08-01 12:21:58 +00:00
drh
721dfcf544 Fix the ANALYZE command to work with partial indices.
FossilOrigin-Name: 60353124f4e965393ecd864019bdbca1999fb69e
2013-08-01 04:39:17 +00:00
drh
8a9789b6c1 Test cases and bug fixes for the partial index logic.
FossilOrigin-Name: 6b73ae7c123801787c8994113cbeb87ee96ba653
2013-08-01 03:36:59 +00:00
drh
b2b9d3d758 Add the logic to keep partial indices up to date through DML statements and
when new partial indices are created.  This new logic is untested except to
verify that it does not interfere with full indices.

FossilOrigin-Name: fb9044d15ad4fd6ae4a38858c0c0e6fe9d4faa25
2013-08-01 01:14:43 +00:00
mistachkin
c6fc65ce08 Limit the number of memset() calls used when determining a temporary file name on Windows. Also, fix a harmless compiler warning.
FossilOrigin-Name: 136fc2931b156f91cdd76a7a009298cdf09d826a
2013-07-31 23:28:36 +00:00
drh
4bd5f73fa0 Add logic to the query planner to only use partial indices if the WHERE clause
constrains the search to rows covered by the partial index.  This is just
infrastructure.  The key routine, sqlite3ExprImpliesExpr(), is currently a
no-op so that partial indices will never be used.

FossilOrigin-Name: 8ca3eac111e06a1854f878a74bffe8f20eb47f1b
2013-07-31 23:22:39 +00:00
mistachkin
aa82eba40d Slight modifications to path name translation handling for Cygwin.
FossilOrigin-Name: 33ba1f4c5dc2ef8292adf17a32ade0cde0887d88
2013-07-31 22:39:26 +00:00
mistachkin
16a2e7a053 Use a new error code to represent a failure to get the configured temporary directory on Windows.
FossilOrigin-Name: c93d891b03c626b9ed01ed5ef2f246b2d4a40a64
2013-07-31 22:27:16 +00:00