Commit Graph

12771 Commits

Author SHA1 Message Date
drh
ddef5dc044 When the estimated cost to do a sort overwhelms the estimated cost to do
individual table lookups, make sure that the table lookup costs are still
taken into consideration when selecting the lookup algorithm.

FossilOrigin-Name: ec5d84ba69c100d9565425ed74040a49e410ea03
2014-08-07 16:50:00 +00:00
drh
858b638d1f A couple more harmless compiler warnings eliminated.
FossilOrigin-Name: bcf6d775f90f4d1ba018a1b965f2f710df130f01
2014-08-06 18:50:51 +00:00
drh
e8f2c9dc71 Fix two more harmless compiler warnings. Make sure the fts3_unicode2.c file
is in sync with mkunicode.tcl.

FossilOrigin-Name: a2a60307ea68a3230952a56cb65369ba0a208967
2014-08-06 17:49:13 +00:00
drh
5402710b0b Fix harmless compiler warnings. In the command-line shell, report if the
".system" command returns a non-zero result.

FossilOrigin-Name: 1202e9771f6d699dbf5268368108a3527d06d799
2014-08-06 14:36:53 +00:00
drh
ede7ae31f1 Fix an obsolete comment in the func.c source file. No changes to code.
FossilOrigin-Name: 5c6bb57d90bad32785d6d9cdf110a825bbc5ec73
2014-08-06 11:58:40 +00:00
drh
2abe6a281c On the windows VFS, do not try to make InterlockedCompareExchange an
overloadable function, since sometimes it is a macro.

FossilOrigin-Name: ab1a751e1304749bef5bc5c833f9abed8950f7d0
2014-08-06 11:57:54 +00:00
mistachkin
17835a5443 In the Win32 VFS, work around InterlockedCompareExchange() being a macro on some platforms (e.g. x64).
FossilOrigin-Name: 7be244ce129d6502f3a3e3f3e8a1dd61ef71d878
2014-08-06 03:06:01 +00:00
drh
da2e5862d1 Merge all recent changes from trunk.
FossilOrigin-Name: a353a8515fb2eff86042d0c33e39772f4d04e0b3
2014-08-06 02:03:35 +00:00
drh
bc5cf3813e Fix typos in the opcode documentation. Comment changes only. No changes
to code.

FossilOrigin-Name: 717245d48714c08156c9b7636aaa6c3a402bad66
2014-08-06 01:08:07 +00:00
drh
0c4de2d96d A simpler fix for ticket [3a88d85f36704eebe1] - one that uses less code.
The error message is not quite as good, but as this error has apparently
not previously occurred in over 8 years of heavy use, that is not seen as
a serious problem.

FossilOrigin-Name: 0ad1ed8ef0b5fb5d8db44479373b2b93d8fcfd66
2014-08-06 00:29:06 +00:00
drh
1cfc9aa993 Ensure that aggregate functions are not used when evaluating a default
value for a table column.
Candidate fix for ticket [3a88d85f36704eebe134f7].

FossilOrigin-Name: 29ba812825bf06ef230f2480bba0579653f0a52d
2014-08-05 21:31:08 +00:00
drh
42191f6248 Add the ability to evaluate IN operators as a sequence of comparisons as
an alternative to the long-standing algorithm of building a lookup table.
Use the new implementation in circumstances where it is likely to be faster,
such as when the RHS of the IN changes between successive evaluations.

FossilOrigin-Name: 952868216854e8355edf57af62bd1a6bcb70ce61
2014-08-05 19:16:22 +00:00
drh
2c5e35ffd1 Rename the internal Schema.flags field to Schema.schemaFlags.
FossilOrigin-Name: 5ae80b3c8f032528359c8c762505ce24da8db96f
2014-08-05 11:04:21 +00:00
drh
4336b0e64a Improved VdbeCoverage() macros. A few minor simplifications to generated
VDBE code.

FossilOrigin-Name: 01f60027ad1841051fa493a646141445f8971357
2014-08-05 00:53:51 +00:00
drh
2c3ea0694f Part of the change in the previous check-in was incorrect and can result
in an incorrect UPDATE for WITHOUT ROWID tables.  This check-in fixes the
problem.

FossilOrigin-Name: ee5f6eae57a656d09a4b3f7fbef664b2c696ddb4
2014-08-04 21:26:58 +00:00
drh
7248a8b2b9 Further enhancements to IN-operator processing.
FossilOrigin-Name: 7fdf26da1d2f40b80f9e44ff6f5af22ace8f95f3
2014-08-04 18:50:54 +00:00
drh
a976979b6e Refinements to the enhanced IN-operator logic.
FossilOrigin-Name: 92ba2821468ecbfac2469161d81c873de67b2243
2014-08-04 16:39:39 +00:00
drh
bb53ecb1db Enhancements to the code generator for the IN operator that result in much
faster queries in some cases, for example when the RHS of the IN operator
changes for each row of a large table scan.

FossilOrigin-Name: 436e884215e2b33ca3fbb555362237b12827c07a
2014-08-02 21:03:33 +00:00
mistachkin
16d511a664 Remove (newly) incorrect preprocessor check to fix build on WinRT.
FossilOrigin-Name: ba7826542908eac2e14789d183d0b3e35b143fed
2014-08-02 20:44:13 +00:00
drh
4c259e9f40 A better comment on the generated code for the NULL-in-RHS-of-IN detection
logic.

FossilOrigin-Name: 9bc1c730a366e75b760b58e7a343d39165b2a469
2014-08-01 21:12:35 +00:00
drh
6be515ebe0 Improved detection and handling of NULL values on the RHS of a IN operator.
FossilOrigin-Name: 468e730036edac22cfeb9ea3515aa16e6bcd6650
2014-08-01 21:00:53 +00:00
drh
e21a6e1dfe Remove an unnecessary OP_Null in the IN-operator logic. Attempt to clarify
comments explaining the IN-operator code, though it is not clear that the
comments are correct even yet - more work to be done.

FossilOrigin-Name: c11e55fabbc718cb324ecd3540453c25db98f50c
2014-08-01 18:00:24 +00:00
drh
5c3e9cf9de Clean up the IN operator code generation logic to make it easier to reason
about.  In the process, improve code generation to omit some unused OP_Null
operations.

FossilOrigin-Name: 7c6fbcfe6ed5739e8e4639b7b123fbf9828cbfc0
2014-08-01 15:51:36 +00:00
drh
e80c9b9ad5 The idea of coding IN operator with a short list on the RHS as an OR expression
turns out to be helpful.  If the list is of length 1 or 2, the OR expression
is very slightly faster, but the ephemeral table approach is clearly better for
all list lengths greater than 2.  Better to keep the code simple.

FossilOrigin-Name: e13175d3579e1045165bab091b3b28951d691704
2014-08-01 15:34:36 +00:00
drh
3a85625d87 Begin making changes to the IN operator in an attempt to make it run faster
and to make the code easier to understand.

FossilOrigin-Name: ee0fd6aaf94cda1dce3fe752bfe3b0f83e0043f1
2014-08-01 14:46:57 +00:00
drh
cefc87fca5 Enhance the PRAGMA integrity_check command to detect UNIQUE and NOT NULL
constraint violations.

FossilOrigin-Name: 9abcf2698c09f4f6a44a68e74f9f6b538f3253d6
2014-08-01 01:40:33 +00:00
drh
5f1d1d9c87 Refactoring: Change "pIndex->onError!=OE_None" to use a macro:
"IsUniqueIndex(pIndex)".  Easier to understand that way.

FossilOrigin-Name: e75b26ee357bb3d3c1a539b05d633ebf314726d7
2014-07-31 22:59:04 +00:00
drh
37e08081f3 Omit a pointless OP_Null when processing a value-list RHS of an IN operator
where the LHS is a rowid.

FossilOrigin-Name: 1361450a9dfe9476e8df98f370a3695752252245
2014-07-31 20:16:08 +00:00
mistachkin
202cb64189 Optimizations to the OS sub-type checking in the Win32 VFS.
FossilOrigin-Name: 1e5489faff093d6a8e538061e45532f9050e9459
2014-07-31 18:54:01 +00:00
dan
f6296cafc5 Add a missing call to "test_sqlite3_log" to multiplex.test.
FossilOrigin-Name: 0708f9df23a325349f658741358c5994b5c4c873
2014-07-31 18:14:37 +00:00
dan
e8559837e6 Fix a leaked statement handle in pager2.test.
FossilOrigin-Name: 47457b0488abcbec2137abf706c1d677563b9ea5
2014-07-31 17:35:40 +00:00
drh
4387006c18 Deactivate the DISTINCT in a SELECT on the right-hand side of an IN operator,
since it should not make any difference in the output but dues consume extra
memory and CPU time.

FossilOrigin-Name: f4cb53651b1e352fae7378878b830a902bcd9248
2014-07-31 15:44:44 +00:00
mistachkin
0174ffa976 Re-integrate the recent changes from the 'winMutex' branch back into the Win32 mutex subsystem.
FossilOrigin-Name: 5360ecb0b8891d0c27f3f02d81b6c7b548361a10
2014-07-30 23:11:16 +00:00
drh
d42d0bed94 Add three new static mutexes for use by the application. This is a partial
import of changes from the threads branch.

FossilOrigin-Name: 3aad01960f92c5e77dba64ac1a6c6b063378fb97
2014-07-30 21:10:12 +00:00
drh
c0fea3cf53 Add a new sqlite3FaultSim() call to vdbePmaReaderSeek() to facilitate
tests of error handling in the sorter.

FossilOrigin-Name: 655d8cfc752b3f5f63521a57f2155f8e14aaf7c4
2014-07-30 18:47:12 +00:00
drh
c690461ea1 Mark some invariants in the vdbesort.c logic when SQLITE_MAX_WORKER_THREADS==0.
FossilOrigin-Name: 721cd965859c9ccc24d2a1d2851c914229e584b3
2014-07-30 17:21:37 +00:00
drh
a1a8298c2e Add the "eForce" parameter to the sqlite3_multiplex_shutdown() entry point
in test_multiplex.c.  Shutdown is forced if true.  Shutdown is not done if
there are pending database connections and eForce is false, but an error log
entry is made instead.

FossilOrigin-Name: c7303d0139f7e7f4fa7060b52942e6c6c6d4b622
2014-07-30 15:43:05 +00:00
drh
bd1c881a91 Merge recent trunk changes, and especially the fix for the CREATE UNIQUE INDEX
problem of ticket [9a6daf340df99ba9].

FossilOrigin-Name: 5b50a8380b2b678c1646ff303e3696efc1d7d92c
2014-07-30 14:44:24 +00:00
drh
ac50232d0f Ensure that the correct number of columns in a UNIQUE index are checked for
uniqueness, regardless of whether or not the original table has a ROWID or
if the columns are NOT NULL, etc.  Ticket [9a6daf340df99ba93c].

FossilOrigin-Name: 6b785e92f279cb65746834d5cd25594fd3333342
2014-07-30 13:56:48 +00:00
mistachkin
0479c6ab9b Disable an assert that is sometimes generated spuriously.
FossilOrigin-Name: bd9ee0ea69181526cfc3cadac33a5ec5190112b0
2014-07-29 21:44:13 +00:00
mistachkin
a7f37491a7 Enhancements and updates to the Win32 mutex subsystem.
FossilOrigin-Name: ca9868cdae19045dc522490b34dee0f14d928ebe
2014-07-29 19:54:03 +00:00
mistachkin
acd57ea0c2 Update return value checking to conform to the beginthreadex() specs.
FossilOrigin-Name: 3144a16f91364b455e54e6030714e1c12ab0bdb7
2014-07-29 19:00:43 +00:00
mistachkin
7c2231cf3b Add a couple more assert statements.
FossilOrigin-Name: 4e816db235025c7998c649fddabfd807290a08b9
2014-07-29 18:53:01 +00:00
drh
b92284de11 Fix unreachable branches in the threads.c module.
FossilOrigin-Name: 3175e366bbf7579ec9ab27214b0a4e5cd27ea204
2014-07-29 18:46:30 +00:00
mistachkin
edd93c3349 Merge updates from trunk.
FossilOrigin-Name: 08c9a4ea6353900095a471365a8611a443f5f399
2014-07-29 18:03:36 +00:00
drh
cd4b637760 Fix a harmless compiler warning.
FossilOrigin-Name: 216d21d0e62b3c0ad49f3cb395c845bf4f17ac61
2014-07-29 17:22:12 +00:00
mistachkin
b1ac2bc8da Make the Win32 thread handles are available after the threads exit.
FossilOrigin-Name: 565c5af7a75ad5c759ce1a61dab3a61c42819644
2014-07-29 16:37:53 +00:00
drh
19f30dc171 Fix the threads build on Windows when SQLITE_MAX_WORKER_THREADS is greater
than 0.

FossilOrigin-Name: f37db3a03d95b508066745613029b7dd1240b31c
2014-07-29 15:18:00 +00:00
drh
011b2e5dd3 Merge the R-Tree fix and the new SQLITE_TESTCTRL_ISINIT test control from
trunk.

FossilOrigin-Name: b2f7eb3cc27ecf9a6a88907991148bca1a7d54b3
2014-07-29 14:16:42 +00:00
drh
43cfc230ab Add the SQLITE_TESTCTRL_ISINIT file control.
FossilOrigin-Name: 8b651d4d6cde7efbc0cc7155948f477477be100e
2014-07-29 14:09:21 +00:00
dan
57ff60b19b Have calls to the xFilter() method of rtree virtual tables ensure that cursor is initialized before proceeding. Fix for [d2889096e7bdeac].
FossilOrigin-Name: 8cc41b0bf365af47c2061ffe44c86018945dd239
2014-07-29 11:54:18 +00:00
mistachkin
d6918657d8 Enhancements and updates to the Win32 mutex subsystem.
FossilOrigin-Name: 18984c321049a759f6619cfa17fb3f4e7b3e08ea
2014-07-29 05:49:02 +00:00
mistachkin
fc129698e0 Add some asserts to the Win32 mutex subsystem.
FossilOrigin-Name: e8f2dc5fadae96252649875c234fcdef1108bd48
2014-07-29 00:42:39 +00:00
drh
2b49327d08 Fix the build on windows.
FossilOrigin-Name: 2773a5f9879a106a89a3d0bc3c5bfdcb2fe43c7c
2014-07-29 00:23:08 +00:00
drh
bde27aaa5a Remove an unnecessary parameter from vdbeMergeEngineStep(). Rename a couple
other routines to be more descriptive of what they do.

FossilOrigin-Name: f2407a40f339fa6c2cec194f78ae7c93655b1ec1
2014-07-28 20:16:41 +00:00
drh
d906514d98 Rename vdbeIncrMergerInit() to vdbeMergeEngineInit() - a much more accurate
name.

FossilOrigin-Name: 5b084a2dd581141b2d0cd9d1a5975625f65ec34d
2014-07-28 19:58:41 +00:00
drh
8a4865f139 In vdbesort.c, rename vdbeSorterDoCompare() to vdbeMergeEngineCompare() and
move it closer to the one place where it is called.  Other minor comment
changes.

FossilOrigin-Name: 09d50d9f0fe7df26dadb0a332731683a07a89fde
2014-07-28 18:57:40 +00:00
drh
a4c8ca049e In vdbesort.c, rename all pointers to sqlite3_file objects "pFd" and use the
name "pFile" only for pointers to SortFile objects.  Other comment enhancements.

FossilOrigin-Name: 518290a7fc0994f9593c5c3ba5b2610a1b86dae1
2014-07-28 17:18:28 +00:00
drh
966d9f267f Merge recent trunk changes into the threads branch.
FossilOrigin-Name: 163c247bd8280ab14fe577329c631c8bd884707f
2014-07-28 15:01:37 +00:00
drh
ac65196e4d Improvements to comments in the multi-threaded sorter. Also include a
function name change for clarity.  And add a test to help show that the
MergeEngine object is only used by a single thread.

FossilOrigin-Name: 9af50a878f67c1c2a4f1520160cc989650d7196a
2014-07-28 14:54:50 +00:00
drh
e6bc1ef68f Remove an unreachable branch from the sqlite3_value_numeric_type() interface.
FossilOrigin-Name: 5350229b52b18a4961858a30538c5c75e5bd3048
2014-07-26 20:12:56 +00:00
drh
975b4c6e8b Avoid unnecessary no-op calls to applyNumericAffinity() for a small
performance improvement.

FossilOrigin-Name: 413d7287977702fa651c0140bd5cf29021fe3e79
2014-07-26 16:47:23 +00:00
drh
eac5bd7870 Try to fix harmless compiler warnings reported by Fortify.
FossilOrigin-Name: e0fa6fdc14ac5458f9200cbae124f8025ea534ea
2014-07-25 21:35:39 +00:00
drh
5dad9a3497 Improved comments on VDBE opcodes, for better documentation. No code
or logic changes.

FossilOrigin-Name: 2d32e4876e0b162730f81e5c2658be12d64a9a99
2014-07-25 18:37:42 +00:00
drh
8af3f772c1 Add constraints (enforced only when SQLITE_DEBUG is enabled) on the use of
OP_Next and OP_Prev.

FossilOrigin-Name: 2230c74f1efa591770176c9b40e920724a3c39e1
2014-07-25 18:01:06 +00:00
drh
f8c7e053ed Improve the performance of the ANALYZE command by taking advantage of
UNIQUE constraints on indices.

FossilOrigin-Name: 114dcf33670fd98a1ebbac0e44f66b2d8bcccddf
2014-07-24 23:23:26 +00:00
drh
d15f87ecfd Fix a bug in the whereRangeSkipScanEst() procedure (added by
check-in [d09ca6d5efad3e4cfa]) where it fails to consider the possibility
of a ROWID column when computing the affinity of a table column.

FossilOrigin-Name: 6aea2258dd7d3967900cefe4cd0af48a7ee7e169
2014-07-24 22:41:20 +00:00
drh
b12879fd1a Avoid trying to allocation zero bytes when analyzing a unique non-null index.
FossilOrigin-Name: 85e2badeeb7f7599eb6fd35512f9bd524f0b1b3f
2014-07-24 20:25:16 +00:00
drh
9d793325b0 Avoid change tests when analyzing single-column unique indexes after
getting past the initial NULL entries.

FossilOrigin-Name: 4690e99c07024f40fafba1db8e4487b287b788a9
2014-07-24 19:54:20 +00:00
drh
2bd2c29a95 Merge all recent trunk changes into the threads branch.
FossilOrigin-Name: 770685892c8f09b9cddb2fbb2877cfb291e19425
2014-07-24 16:54:28 +00:00
drh
ba5b09319e Add the readfile(FILENAME) and writefile(FILENAME,CONTENT) SQL functions to
the command-line shell.

FossilOrigin-Name: fb1048cb2b613a0dbfe625a5df05e9dcd736a433
2014-07-24 12:39:59 +00:00
drh
c4747f2314 Add support for hexadecimal integer literals in the parser.
FossilOrigin-Name: f8f79f28785db716b10c3bc9d6652b98253fd125
2014-07-24 12:19:41 +00:00
drh
6976c2123b In the command-line shell, in CSV output mode, terminate rows with CRNL but
do not expand NL characters in data into CRNL.  Provide the extra -newline
command-line option and the extra argument to .separator to designate an
alternative newline character sequence for CSV output.

FossilOrigin-Name: 16c8ce10e1530731441e6c4538691b71564684ed
2014-07-24 12:09:47 +00:00
drh
dbd9486d5b Add experimental "costmult" logic. Only enabled when compiled with
-DSQLITE_ENABLE_COSTMULT.

FossilOrigin-Name: 729ece40885ed7f52c5981364833fc62281a388b
2014-07-23 23:57:42 +00:00
drh
6861b8a13f Ugh. Consecutive UNIQUE index entries are only distinct if the index is
on NOT NULL columns.  So the previous version was not quite right.  This
check-in fixes the problem.

FossilOrigin-Name: 30033f965030a015fad15e532bcaba1314c8cc0f
2014-07-23 19:37:21 +00:00
mistachkin
3b9fab1cb9 Enhancements to the hex literal tests.
FossilOrigin-Name: a3cc027fa7ca41da23ecd0770a075a48416af020
2014-07-23 19:04:25 +00:00
drh
553818a0aa Improve the performance of the ANALYZE command by taking advantage of the
fact that every row of a UNIQUE index is distinct.

FossilOrigin-Name: 3e1e79e1335f7ad33cd35f384f2a063c4aa2253b
2014-07-23 18:36:55 +00:00
drh
11d451eb8a Updated documentation on sqlite3_temp_directory. No changes to code.
FossilOrigin-Name: e6225a7bf77a700b318563b1a854b4b3a9e031e1
2014-07-23 15:51:29 +00:00
drh
1b7ddc5915 Remove a surplus function prototype. #ifdef code that is not used when
hex integers are omitted at compile time.

FossilOrigin-Name: a5b383e077e4b277a65920f7cc202f32f07aa9ee
2014-07-23 14:52:05 +00:00
drh
9296c18a50 Change the hex literal processing so that only the SQL parser understands
hex literals.  Casting and coercing string literals into numeric values does
not understand hexadecimal integers.  This preserves backwards compatibility.
Also:  Throw an error on any hex literal that is too big to fit into 64 bits.

FossilOrigin-Name: 6c6f0de59bf96b79c8ace8c9bfe48c7a6a306a50
2014-07-23 13:40:49 +00:00
drh
5ec659cfcb Casting hex literals directly from string to float always results in a
positive number.

FossilOrigin-Name: 4b86ccdf4f4eb4339a5706e10ad24f01b6c3939e
2014-07-23 02:07:11 +00:00
drh
d35588dc21 Reformatting a few test cases for clarity.
FossilOrigin-Name: 7e1bbacb11a4689b69856450125cae3d045307af
2014-07-23 01:59:47 +00:00
drh
fce4da1b73 Test cases for hex literals.
FossilOrigin-Name: 19054339c47448bcdfd1f7be35daa3826c409077
2014-07-23 01:56:32 +00:00
drh
28e048c618 Add support for parsing C-style hexadecimal literals.
FossilOrigin-Name: 34a1f38b7a23c64f5c6e5b34c19a20480be53961
2014-07-23 01:26:51 +00:00
drh
0f65cce825 When running ANALYZE, it is not necessary to check the right-most key column
for changes since that column will always change if none of the previous
columns have.

FossilOrigin-Name: 48f40861db4fbd10725a2b8b606d44fe16d5bd27
2014-07-22 22:46:54 +00:00
drh
3526319b48 Add the OP_ReopenIdx opcode that works like OP_OpenRead except that it becomes
a no-op if the cursor is already open on the same index.  Update the
OR-optimization logic to make use of OP_ReopenIdx in order to avoid
unnecessary cursor open requests sent to the B-Tree layer.

FossilOrigin-Name: 77f412caf0192d3e7fecb377d6d72123d8b64424
2014-07-22 20:02:19 +00:00
drh
a45fdc7b1e The optimization of check-in [b67a6e33f2] does not work (it generates
incorrect VDBE code) if an OR term is AND-ed with a constant expression.
So back that optimization out and add a test case to make sure it does not
get added back in.

FossilOrigin-Name: eed754fe93644f4df082eac0c0a7ffc5c78ccd10
2014-07-22 19:14:42 +00:00
drh
f5d87f77e2 Fix the index name for the shadow tables in the spellfix1 extension so that
multiple instances of the spellfix1 virtual table can each have their own
index.

FossilOrigin-Name: 438c348a40383796a710499e4e1b7a6b08f75778
2014-07-22 16:00:49 +00:00
drh
d08b27988c Correction: The maximum SQLITE_MAX_ATTACHED value to avoid overflowing a
signed 8-bit integer is 125, not 127.

FossilOrigin-Name: 48e378029528dac33d29866016128d236a7995d9
2014-07-22 15:33:31 +00:00
drh
25df48d967 Enhance the sqlite_stat1.stat parsing to allow additional text parameters
at the end.  Unrecognized parameters are silently ignored.

FossilOrigin-Name: ca2a5a2c770fa94cd8db1b1b241ede058a7c58e2
2014-07-22 14:58:12 +00:00
drh
358406fc57 Expire prepared statements after running ANALYZE.
FossilOrigin-Name: b083a961f8ac3a6158e822574d73cd63e3103b09
2014-07-22 14:42:16 +00:00
drh
83a305f20e Enhance the comment on whereLoopAddBtree(). No changes to code.
FossilOrigin-Name: b22dd165da227a52d88b17a91e80a1701dce61ad
2014-07-22 12:05:32 +00:00
drh
53ad7e48ab For the OR-optimization, avoid generating OP_OpenRead opcodes that reopen
exactly the same index.

FossilOrigin-Name: b67a6e33f23ce5f5d9a545fa9d6700a7ed636901
2014-07-22 00:40:45 +00:00
drh
215c0c82fa Limit the maximum SQLITE_MAX_ATTACHED to 127, since a signed character
is sometimes used to store the database index.

FossilOrigin-Name: f1c76c7c4c7d16855db60d16e23ecdf8d7ca862a
2014-07-21 20:07:17 +00:00
drh
a7ab6d8165 Allow the SQLITE_MAX_ATTACHED compile-time option to be larger than 62. The
default limit on the number of attached databases remains 10.

FossilOrigin-Name: 1a817ae2f35fa0396148dda2782cd4f919bf5c6f
2014-07-21 15:44:39 +00:00
dan
857745c089 Update the sqlite3_stmt_busy() function so that it correctly returns true for "ROLLBACK" statements that have been stepped but not yet reset.
FossilOrigin-Name: 61cee3c0678f5abd9131a29ab946a5e71f55643e
2014-07-19 17:57:10 +00:00
drh
33af1a6faa Fix harmless compiler warnings in the showdb and showwal tools and in
the unicode tokenizer of FTS3.

FossilOrigin-Name: 574cc8eb1448cff67390f2e16cc9b7c3ddd4658b
2014-07-19 17:49:40 +00:00
mistachkin
86ac612e8a Fix some harmess compiler warnings in the FTS3 Unicode module.
FossilOrigin-Name: c01caea5d6ad7a570628b85fb3056ac955ff03dd
2014-07-19 15:44:29 +00:00
mistachkin
ef60703e8f Fix warnings related to having a 64-bit size_t.
FossilOrigin-Name: 29ac9336dba2b62d13315cecfc5c4a74cc54087a
2014-07-19 15:40:39 +00:00
mistachkin
35683976a4 Fix warnings caused by the previous commit.
FossilOrigin-Name: 89634a419d0c1ef899d0591c7c6ab9290bf665d2
2014-07-19 15:30:01 +00:00
mistachkin
0461cc4795 Fix harmless compiler warnings for MSVC in the showdb/showwal command line tools.
FossilOrigin-Name: 6dc7b2f119eb92da17c9e914bdad30a9ceaebdb5
2014-07-18 21:16:37 +00:00
mistachkin
3a046c6c31 Update clean targets with the recently added command-line tools.
FossilOrigin-Name: 2beefa68c0c53f663321bebf0ac06f6c936be63f
2014-07-18 21:02:54 +00:00
drh
a6f5972c75 Improved documentation for checkpoints and the busy handler. No changes
to code.

FossilOrigin-Name: ca92c0240681b199c4b8ecc557792b8aea71692d
2014-07-18 19:06:39 +00:00
drh
71607c77c8 SQLite has long accepted some unadvertised and non-standard join syntax.
Add a test to ensure that future versions continue to accept this non-standard
syntax, to avoid breaking legacy applications that use the undefined syntax.

FossilOrigin-Name: 824dde7fc48dbca6d6c956c4eb79bbfa2d139ee5
2014-07-18 17:39:48 +00:00
drh
56f674c8a0 Improvements to the ".fullschema" command in the command-line shell.
FossilOrigin-Name: fa80c64caa573297bf43cb5b11d9e7db58567200
2014-07-18 14:43:29 +00:00
mistachkin
166c373779 Fix harmless compiler warnings in the fts3view utility program that can occur with MSVC.
FossilOrigin-Name: 1cec1e030035e5253fb7ebbdfe5c1a3029e4e29b
2014-07-07 18:03:38 +00:00
mistachkin
de54527fb2 Add the fts3view utility program to the MSVC makefile.
FossilOrigin-Name: b04751bd59fed513ab615e7f368fe25c64b3607c
2014-07-07 17:57:50 +00:00
drh
42d3d37ad1 Fix a division-by-zero error in the fts3view utility program. Add the
fts3view utility program to the "main.mk" makefile.

FossilOrigin-Name: 64f02699b4bd747e4c2f0debf72d37ec275137d8
2014-07-07 16:07:43 +00:00
dan
2eaf03d72b Change fts3/4 so that the "unicode61" is included in builds by default. It may now be excluded by defining SQLITE_DISABLE_FTS3_UNICODE.
FossilOrigin-Name: 0cc0230ae9cfc9760fd8ef2c25e82576b052dbeb
2014-07-03 12:18:22 +00:00
dan
43fbe5e2c9 Add another test to verify that SQLite is using stat4 data for composite primary keys on WITHOUT ROWID tables.
FossilOrigin-Name: 0df1fe72f8271abc86cd552027d938c910f90967
2014-07-01 15:22:11 +00:00
dan
39caccf83d Ensure that all fields are loaded from the stat4 table for records that correspond to indexes on WITHOUT ROWID tables with composite primary keys.
FossilOrigin-Name: 21981e35062cc6b30e9576786cbf55265a7a4d41
2014-07-01 11:54:02 +00:00
drh
6614181610 Merge the latest trunk changes into the threads branch.
FossilOrigin-Name: ae23a65eb1547fbe8b86ab71477071990a22d31d
2014-06-30 20:25:03 +00:00
drh
49e77b1925 Bump the version number to 3.8.6.
FossilOrigin-Name: f925e9baafea625f63105f8013abb3807b418379
2014-06-30 19:28:57 +00:00
drh
855f63908f Attempt to use STAT4 information to estimate the selectivity of WHERE clause
terms when using the skip-scan optimization.

FossilOrigin-Name: d09ca6d5efad3e4cfa93a4dc711e6ba6079d4b4b
2014-06-30 19:07:58 +00:00
drh
c7de8267a8 Fix for ticket [b2fa5424e6fcb15]: Better define the format of the sqlite_stat4
file for WITHOUT ROWID tables and make sure the ANALYZE command generates a
file in the appropriate format.  Use the sqlite_stat4 data to enable the use
of WHERE terms that cover all indexed columns plus some prefix of columns
in the primary key.

FossilOrigin-Name: bc2de8095fa9c385db0adf22ca55b0298a33c284
2014-06-30 18:57:53 +00:00
dan
fd984b8114 Fix a problem in where.c with using the stat4 sample data of an index on a WITHOUT ROWID table.
FossilOrigin-Name: 053a210e3169732c58f84cb54c9b6f6df3a8f4ea
2014-06-30 18:02:20 +00:00
drh
ec9e55d358 Fix the STAT4 information for WITHOUT ROWID tables.
FossilOrigin-Name: 5d8628fdffbcf837313958f0ee1ed8a2043d384e
2014-06-30 17:07:39 +00:00
dan
39129ce8d9 Fix where.c so that the primary key values appended to every index entry on a WITHOUT ROWID table may be used when useful.
FossilOrigin-Name: 6624a61d16e47ad691c4195ca8a1d68b7348118d
2014-06-30 15:23:57 +00:00
drh
971fd07135 Omit non-primary-key columns from the STAT4 samples for WITHOUT ROWID tables.
Indexes, both rowid and without-rowid, still hold an exact copy
of the index entry.

FossilOrigin-Name: de826c31589258f0906f87d65796944103e36d5b
2014-06-30 13:56:34 +00:00
drh
48be0c51d4 Generate complete samples for sqlite_stat4 on WITHOUT ROWID tables.
Ticket [b2fa5424e6fcb15b5]

FossilOrigin-Name: 8cb43eddab83c68b2163441df70e0e9496d5fa33
2014-06-30 13:32:39 +00:00
drh
4bb77ecaa8 Add makefile targets for various diagnostic tools, such as showstat4.
Fix harmless compiler warnings in diagnostic tools.

FossilOrigin-Name: 6f86d89b8800c50035da7809bff941d08a33a6a2
2014-06-30 11:14:26 +00:00
dan
6696ba3eab Add an OOM fault injection test for the new code on this branch.
FossilOrigin-Name: c96de490ac77dd23c108004b95152cce4922fe27
2014-06-28 19:06:49 +00:00
dan
8e9028d0f8 Add further tests to skipscan5.test.
FossilOrigin-Name: 4b8230e8fe93e73a615a46708aed5fa3557b6228
2014-06-28 17:35:15 +00:00
drh
0288b21e54 Add header comments on new routines. Rework the sqlite3Stat4Column() routine
so that is (in theory) able to deal with corrupt samples.

FossilOrigin-Name: ef5cdf949bb53a2958fa34e176b4b9eeda269de5
2014-06-28 16:06:44 +00:00
dan
fa8874542c Fix a problem with using stat4 samples of type text when estimating the rows visited by a range-query/skip-scan loop.
FossilOrigin-Name: dfb09db6d412f3bc2a71bda393813783580dbad1
2014-06-28 15:26:10 +00:00
drh
3eddb23e31 Change the VDBE to export the sqlite3MemCompare() routine and thus free
where.c from the dependency on vdbeInt.h.

FossilOrigin-Name: d186d1ac3c47f0d814636c4b8386a6065a294750
2014-06-28 14:28:06 +00:00
dan
4364dc5ea6 Merge fixes from trunk with this branch.
FossilOrigin-Name: 6af219d1b83ec54b3fb4ad4e6216d9ad9ea0fc70
2014-06-28 14:25:32 +00:00
dan
4e42ba4a35 Fix a couple of problems in estimating the number of rows visited by a range query that uses a skip-scan.
FossilOrigin-Name: 219736f54dcd1448af3400e699f1c20755ac6876
2014-06-27 20:14:25 +00:00
mistachkin
5d24951865 Add some more IN operator tests.
FossilOrigin-Name: fb32e374b75b160e7b535e732ced6c34dbb513eb
2014-06-26 22:17:21 +00:00
mistachkin
2d84ac480b Fix compilation issue when STAT4 is not enabled.
FossilOrigin-Name: 74a5454a710e1b7d8575cec2f872e6110aefce17
2014-06-26 21:32:09 +00:00
mistachkin
9bec6fb3ef Revise the affinity returned for expressions flagged as 'generic'. Fix for [9a8b09f8e6].
FossilOrigin-Name: 92f7ad43dbfe4e02490df2f932c3c74fb89064d6
2014-06-26 21:28:21 +00:00
dan
b0b8290ecb Attempt to use sqlite_stat4 data to estimate the number of rows visited by a range query that uses a skip-scan. This code is largely untested.
FossilOrigin-Name: 01dc8102592427b71a18c2cb82301d2266dd59c2
2014-06-26 20:21:46 +00:00
drh
a9bc3cf736 Fix showstat4.c so that it decodes typecodes 8 and 9 correctly.
FossilOrigin-Name: 9ca737c0b41f87998d842e7772c3e483bb291c50
2014-06-24 20:19:21 +00:00
drh
f127814eae Add the showstat4.exe utility program for decoding and displaying the
content of the sqlite_stat4 table in a database.

FossilOrigin-Name: b4d9f6053d1d95fdc1eab8ce610b51e7df8d896d
2014-06-24 00:59:15 +00:00
drh
c1971541e4 Add the .fullschema command to the sqlite3.exe utility. This command shows
the schema and the content of the sqlite_stat tables, all in one go.  Useful
when reporting problems with the query planner.

FossilOrigin-Name: ebec48921c092e20c9d7608242b63db40b40be5e
2014-06-23 23:28:13 +00:00
dan
685ffb134a Fix a problem with SQLITE_OMIT_WSD builds.
FossilOrigin-Name: 07dda49c1bf8997a18c3368acb81b6d863ea38d6
2014-06-23 10:18:50 +00:00
dan
702eec1cea Fix a problem with SQLITE_OMIT_WAL builds.
FossilOrigin-Name: 612b6d1b1f74eaf618520b90811eca10f978fc71
2014-06-23 10:04:58 +00:00
drh
56e67dd7c7 Improved display of record data in the "NNNbd" output of the showdb.exe
utility program.

FossilOrigin-Name: f735c2497eaad15216c90c6b92fd5ceff460220a
2014-06-20 13:55:06 +00:00
drh
419e04010f In the showdb.exe utility, for the "NNNbd" command, also show data fields
in addition to header fields on each record decoded.  Improvements to 
formatting.

FossilOrigin-Name: b451fe0cb92278deb7724e7995c1bd46ae83c119
2014-06-20 01:32:42 +00:00
drh
6a30cd5a44 Add the ability to decode the headers of individual cells, byte-by-byte,
in the "showdb.exe" utility.

FossilOrigin-Name: 306b461d7c0643b6ac4df944759ecc9ce8581634
2014-06-19 23:38:53 +00:00
drh
267a13fd47 Add the "LogEst" and "LogEst.exe" target to the makefiles.
FossilOrigin-Name: 7b91b0581d169a353462d96120a2e0d4dcc8e8ae
2014-06-18 18:10:12 +00:00
drh
6c34e58e8f Fix a comment on the sqlite3Utf8Read() routine. No changes to code.
FossilOrigin-Name: 5e514f6acebcfad4f18300d1a34f4917f1a746d9
2014-06-18 15:24:40 +00:00
drh
5dfcfe7dc0 Merge in all recent changes from trunk, and especially the automatic index
enhancements.

FossilOrigin-Name: 0e1b73496f861bd497f92f1ead936b2d94aa52d5
2014-06-18 15:18:12 +00:00
drh
f9944b5053 Prevent an automatic index from taking the place of a declared index.
FossilOrigin-Name: 0a52bddd9db49b2b79fc24888b50023d0fe74f7b
2014-06-18 15:11:54 +00:00
drh
dabe36d9dd Prevent an automatic index from taking the place of a declared index.
FossilOrigin-Name: 4ece839d445ff578a449a339ab579a32e64c9d28
2014-06-17 20:16:43 +00:00
drh
ef3ad02d90 Fix a missing space in a "wheretrace" comment. No changes to production code.
FossilOrigin-Name: b500f2a09721b49c95a69c47a0205bc2375af2cd
2014-06-17 17:00:42 +00:00
drh
03202a97f8 Add the likely() function for symmetry with unlikely(). The likely(X)
function means the same thing as likelihood(X,0.9375).

FossilOrigin-Name: 38965484199153e3e5b999f5196c1d66e5296f60
2014-06-17 16:11:28 +00:00
drh
e2bdf6e547 Improvements to query planning, especially in regards to estimating the
cost and benefit of automatic indexes.

FossilOrigin-Name: 1272fb8991b3888c72dcebf947415883d7727241
2014-06-17 15:53:33 +00:00
drh
2daa64cd63 Add the autoindex2.test testing module.
FossilOrigin-Name: ffe3fea47b8ba8ec4557f68243ef3ef5aac00dfd
2014-06-17 13:23:36 +00:00
drh
9740726121 A different approach to the autoindex problem that deletes query-planner code
rather than adding it.

FossilOrigin-Name: f270fb6e9e0b5e77f918081962008c6195ab1e36
2014-06-17 12:33:55 +00:00
drh
9f808299ff Simplification to the logic that prevents automatic indexes from being formed
on constant expressions.

FossilOrigin-Name: 36d67e1dd2b4f4c22d02f3c3b8d372074de5523a
2014-06-17 09:52:26 +00:00
drh
6b7ff748a1 Allow an automatic index on a WHERE constraint where the RHS is does not
reference another table as long as the RHS is not a constant.

FossilOrigin-Name: 58acc2a8b38c5f13175c191697b4d2b663db1872
2014-06-17 09:00:54 +00:00
drh
9978e6a680 Do not attempt to create an automatic index on a constant constraint, as
doing so is pointless.

FossilOrigin-Name: d6883e960f61365729f279a3c1f2c050beb49a55
2014-06-17 02:46:55 +00:00
mistachkin
6fe0338ca9 Fix CSV import issue, reported via the mailing list, in the shell when the file to be imported ends with an empty line.
FossilOrigin-Name: fc918f7d332b8f7cabc79a0f1586bd6760d14d40
2014-06-16 22:45:28 +00:00
drh
0ace74a19c In the "wheretrace" logic (disabled for normal builds) expand the print width
of the flags field to be wide enough for all 17 bits.

FossilOrigin-Name: 3181d2069a788adc719decf65dc1bd2e16650c87
2014-06-16 21:30:29 +00:00
drh
0bdbc90db8 Add the SQLITE_UNLINK_AFTER_CLOSE compile-time option. If enabled, the
unlink of temporary files on unix is deferred until after the file is closed.

FossilOrigin-Name: e43a2f92b616ec885a1ee62911fa8f6991d277f7
2014-06-16 18:35:06 +00:00
drh
2fe708196d Add an application ID for MBTiles tilesets.
FossilOrigin-Name: 837f6404230fc642e9084140c4b30cca1be43375
2014-06-16 18:17:21 +00:00
drh
3044b51d2f Back out the unix VFS changes that seeks to avoid fstat() calls after an
unlink().  That change did not clear the problem on FuseFS.

FossilOrigin-Name: 0617e20a33e08754aea14e60db44e557c13978e3
2014-06-16 16:41:52 +00:00
drh
6d36ffe8f3 Add the ".eqp" dot-command to the ".help" output in the command-line shell.
This was accidently omitted when the ".eqp" command was originally implemented
for SQLite 3.8.4 (check-in [e6ecf7337658624]).

FossilOrigin-Name: b0b4c776c321ca4a792ef67efbc62351eeac247d
2014-06-16 15:01:37 +00:00
drh
a2412c1613 Fix the extension01.test script so that it works on windows. Fix a
harmless compiler warning in the fileio extension.

FossilOrigin-Name: baf95a190907d05a847ae8b6a3dd60625c2a078a
2014-06-16 12:51:56 +00:00
drh
51ed298364 Add test cases for the fileio extension.
FossilOrigin-Name: 8634333127c4d868d3ec27e88b5818f6479774f3
2014-06-16 12:44:32 +00:00
drh
40e75cb6f6 Add the fileio.c loadable extension, that implements readfile() and writefile()
SQL functions.

FossilOrigin-Name: 0ca104d821d5841ab0754113be074c520cf07f23
2014-06-13 13:43:25 +00:00
drh
0b93058b0e Add an extension that implements compress() and uncompress() SQL functions.
FossilOrigin-Name: d5c17d1a423321f766616d82c9b27ef87c1d5afd
2014-06-13 13:08:21 +00:00
drh
5b6e3b9781 Increase the WAL-mode SQLITE_PROTOCOL timeout to 10 seconds.
FossilOrigin-Name: 2aeacf81df92b4fe5d1825c1dc1cd176b8af8bd9
2014-06-12 17:10:18 +00:00
drh
696964d0e5 Simplify the estLog() routine.
FossilOrigin-Name: 6c68d758bce3752f044752404a76bf3ba3eec48f
2014-06-12 15:46:46 +00:00
drh
77ae7ca643 Avoid an unnecessary initialization of the szFile field of unixFile in
the unix VFS.

FossilOrigin-Name: 6484fb5a25c2a0e5d26694285a4908a22c67ba17
2014-06-09 20:39:03 +00:00
drh
4fd7111dcb Enhance the unix VFS so that it keeps track of the size of unlinked files
internally and thus avoids the need to call fstat() on those files, since
fstat() does not work reliably on unlinked files on some implementations
of FuseFS.

FossilOrigin-Name: 10707d35786403ea5392d980f593bfecdae063dd
2014-06-09 20:24:46 +00:00
drh
f5154c6a1c Enhance the unix VFS so that it keeps track of the size of unlinked files
internally and thus avoids the need to call fstat() on those files, since
fstat() does not work reliably on unlinked files on some implementations of
FuseFS.

FossilOrigin-Name: c41df393c6afbfbfdc4d1b885024e083c6f6de1f
2014-06-09 20:06:01 +00:00
drh
62a223e5dd Modify the %nonassoc directive in lemon so that it generates a run-time
error rather than a parsing conflict.  This changes is due to a bug report
on the mailing list.  SQLite does not use the %nonassoc directive in its
grammar so this change does not affect SQLite.

FossilOrigin-Name: 1925f3a0a2caa709569df015a8e0d26412f1a9ff
2014-06-09 13:11:40 +00:00
drh
69e9782f23 Add a test case to ensure that estLog() works for negative numbers.
FossilOrigin-Name: 813469d98519b609669a004b7b604af78ef40c02
2014-06-06 20:49:19 +00:00
drh
c94b2f7d6b Make sure the estLog() routine in the query planner handles negative
values correctly (always returning 1).  Prior to this change, estLog(-1)
would return a large number which could throw off the cost computations
in the query planner in obscure circumstances.

FossilOrigin-Name: 75437bee4905949c66dc7694ea234d4d5aefd981
2014-06-06 20:20:09 +00:00
drh
94aa7e091b Fix an obsolete comment on the whereRangeScanEst() routine. No
changes to code.

FossilOrigin-Name: b16bf8518b7c50f6a939aa54900fea91b1098470
2014-06-06 17:09:52 +00:00
drh
33ca481923 Bring the threads branch up-to-date with the 3.8.5 release.
FossilOrigin-Name: e4b01676d7e7ac14f5120ca3a618cc34dbf5dab2
2014-06-05 13:22:52 +00:00
dan
33b7bcb319 Fix a problem that was causing the FTS4 integrity-check command to fail if the table had one or more "notindexed" columns.
FossilOrigin-Name: 7123bb2605216396f65db5d156431b3613f313b5
2014-06-05 11:15:56 +00:00
drh
98ecc1f3f5 Version 3.8.5
FossilOrigin-Name: b1ed4f2a34ba66c29b130f8d13e9092758019212
2014-06-04 14:06:34 +00:00
drh
d0dc5d4984 Avoid closing a pseudo-table associated with sorting in a co-routine since
that pseudo-table might be used again in an outer loop.

FossilOrigin-Name: 6d81805298ea882f5fee99504d5a95f1a762a90b
2014-06-03 14:42:34 +00:00
dan
5a0b8b124b Add a test to double-check that [1cbe7a0883] did not affect anything.
FossilOrigin-Name: c6b512a724aebcd084aad2a80d020b95773b3012
2014-06-03 11:32:38 +00:00
drh
7f80c7146f Remove the WHERE_LIKELIHOOD bit, as it does not seem to effect any result.
FossilOrigin-Name: 1cbe7a0883e081611a50524517d70e0b6c5199d2
2014-06-02 21:00:34 +00:00
drh
974db61d9d Fix a typo in a requirements mark comment in a test script. No changes to
code.

FossilOrigin-Name: 75ff459b06e1a5c180d316d227ce2f73c99a1f52
2014-06-02 18:24:55 +00:00
drh
2504c6c632 Fix the query planner so that it once again knows that queries without a
FROM clause will never return more than one row and hence do not require
sorting.

FossilOrigin-Name: 9f18b303cd1bc5779d82669884f802c7889b4947
2014-06-02 11:26:33 +00:00
dan
5f43812af8 Add the "valgrind-nolookaside" permutation to permutations.test.
FossilOrigin-Name: 8e8472d9b689d128eb11d3111e009161cf4580f7
2014-06-02 09:39:24 +00:00
drh
01f3754dcd Fix a harmless "scan-build" compiler warning in the command-line shell.
FossilOrigin-Name: 39fafe0a19ff346a2354f00b03f8e8e4b8b0524c
2014-05-31 15:43:33 +00:00
drh
7ef4d1c403 Fix a compile of harmless static analyzer warnings.
FossilOrigin-Name: 7e287f2055dcd82c92d1711aec97cb6552a354bb
2014-05-31 15:39:53 +00:00
mistachkin
110e0ebe6d Revise locking retry semantics in Win32 VFS to abort early if the file handle is reported as invalid.
FossilOrigin-Name: a4df4a5b34111f755ffd9ee6f089ff05d03ebc7a
2014-05-30 21:01:41 +00:00
mistachkin
ff9fcd5a14 Add extra checking of the database extended error code.
FossilOrigin-Name: f2906c44519d76db5bc36013369ae498b80655a8
2014-05-30 16:54:09 +00:00
mistachkin
6b98d67b2b Add tests for the invalid file handle detection logic in the winLock() function.
FossilOrigin-Name: ed5a9eb4f30a395bc641e79254217c7d7cf0aa5d
2014-05-30 16:42:35 +00:00
drh
3c4461f47a Fix a harmless compiler warning in the command-line shell code.
FossilOrigin-Name: a80527f60b4856e869f25e7b13afde351bc26a25
2014-05-29 20:39:59 +00:00
drh
ff14013496 Merge changes from the trunk into the threads branch.
FossilOrigin-Name: 416cb091267de91b9cadee9f7453b8627570b7d3
2014-05-29 20:24:20 +00:00
drh
b463fef3fd Fix to the EXPLAIN indentation logic in the command-line shell.
FossilOrigin-Name: 8f916ed1e185ac728e00624d90e1d7bd2dda4469
2014-05-29 20:17:57 +00:00
drh
c2ce0bea88 Improvements to error messages for errors in the dot-commands of the
command-line shell.  Add the ".once" command.  The output of ".help"
now goes to the designated output channel.

FossilOrigin-Name: 48dce821a07ac29da6ce05e92cf3f6e52b6eb388
2014-05-29 12:36:14 +00:00
drh
dcb3e3d62c Only quote the arguments to the ".shell" and ".system" commands if they
contain spaces.

FossilOrigin-Name: e58f4bd39d51c4c1a28684dab6427de81173d564
2014-05-29 03:17:29 +00:00
drh
62cdde539c Add the ".shell" and the ".system" commands (aliases for the same thing)
to the command-line shell.

FossilOrigin-Name: d018a34a05cec6adda61ed225d084c587343f2a6
2014-05-28 20:22:28 +00:00
dan
3b21f6d62d Add an extra test to verify that the FTS notindexed option is working.
FossilOrigin-Name: c461c0fe051d33cc8b4fede4eca13cd71f28126a
2014-05-28 10:00:38 +00:00
mistachkin
8e86b6a3df Revise locking retry semantics in Win32 VFS to abort early if the file handle is reported as invalid.
FossilOrigin-Name: d43e2e59b5647655595fd953febf2beefa480006
2014-05-28 03:27:42 +00:00
mistachkin
ff0bc8f9f7 Revise how OSTRACE reports logically boolean results in the Win32 VFS.
FossilOrigin-Name: c405f971cf03e29110019ff863cbfb026d97e1e6
2014-05-28 03:23:55 +00:00
drh
e9afc3f279 Remove an incorrect assert() in the sorter.
FossilOrigin-Name: b8b66103de8c554cb87df40bf040760ec29f2ae1
2014-05-27 20:19:06 +00:00
drh
3c559a8d3c Fix harmless compiler warnings.
FossilOrigin-Name: 20b75460c0661b5dc071177b4a0791aceccda029
2014-05-27 19:18:36 +00:00
drh
48dd1d8e28 Change the name of the Index.autoIndex field to Index.idxType and provide
symbolic names for the various values of that field rather than using
magic numbers.

FossilOrigin-Name: d16e575dacc811de0f7b58a0d1cd243678dce6c5
2014-05-27 18:18:58 +00:00
drh
a3bc66a3f5 Avoid unnecessary cursor opens and seeks when running the OR-optimization
on a WITHOUT ROWID table.

FossilOrigin-Name: 9c785c58327e08dad94a278a643a5443f94aec36
2014-05-27 17:57:32 +00:00
drh
3fb6730699 Improved comments on the OR-optimization logic in the query planner.
FossilOrigin-Name: 77fef5a3987fc16f84a8e755283ca6ec1363013c
2014-05-27 16:41:39 +00:00
drh
f53b4ad0f9 Remove unused code (previously #ifdef-ed out) from btree.c.
FossilOrigin-Name: 8bc9737112e2700f337ff377cda040c8ba9d729f
2014-05-27 15:21:42 +00:00
drh
b7231a8cf0 Fix a harmless compiler warning in the FTS4 logic.
FossilOrigin-Name: 64a869ad2388d9d62601b93d5139f2dc57f260f7
2014-05-27 11:54:48 +00:00
dan
c2070c7d96 Add a test to whereI.test that uses a multi-column PK.
FossilOrigin-Name: aa183e60929bdbbcea3c436dd8cc674fc44ad09a
2014-05-27 11:42:23 +00:00
drh
1529908001 Fix for (unsupported) SQLITE_USE_FCNTL_TRACE code.
FossilOrigin-Name: 994b2b7a591f08609140eb504253c141aec6206a
2014-05-27 10:57:37 +00:00
drh
736932c1eb Add the OR-optimization to WITHOUT ROWID tables.
FossilOrigin-Name: 06a23b8b32f0439b22936dc4107890481e4a1327
2014-05-26 22:05:46 +00:00
drh
5609baf35e Minor enhancements to comments and clarification of the code.
FossilOrigin-Name: cbec30d0c49a3f618c3df3ae0ca3d651b48841c2
2014-05-26 22:01:00 +00:00
drh
68c121534c Add a missing VdbeCoverage() macro on an OP_Found opcode added in the previous
check-in.

FossilOrigin-Name: b4980a07e287480beddb2c6633c733520e05d074
2014-05-26 20:25:34 +00:00
drh
79045882c9 Merge recent trunk changes into the threads branch.
FossilOrigin-Name: 8215202759dbd863edf20aa26ff21da20bc35d73
2014-05-26 20:15:21 +00:00
dan
f97dad8849 Enable the OR optimization for WITHOUT ROWID tables. Use a temp table instead of the RowSet object to track the rows that have already been included in the result set.
FossilOrigin-Name: 2c7e277bbebd5c93dec53d381d9737909d40d846
2014-05-26 20:06:45 +00:00
dan
6a8ac852aa Fix a problem in the shell when importing CSV files. If the leftmost field of the first row in the CSV file was both zero bytes in size and unquoted, no data was imported.
FossilOrigin-Name: 856d44a206d82e96265103556dedda39ca3602b1
2014-05-26 18:27:12 +00:00
dan
cde81d5fd0 Fix a problem in FTS4 where columns with names that are prefixes of any notindexed column were also being (incorrectly) marked as not indexed. For example in "CREATE ... t1(abc, bc, abcd, notindexed=abcd)", both abc and abcd were being treated as notindexed.
FossilOrigin-Name: d90c4964fcf46b0b043dbfd58267098582267001
2014-05-26 16:40:02 +00:00
drh
935850ef75 Remove references in comments to VDBE opcodes that no longer exist. This
is a documentation change only; no changes to code.

FossilOrigin-Name: ebfb51fe40756713d269b4c0ade752666910bb6e
2014-05-24 17:15:15 +00:00
dan
e96f2df3dd Changes to the output of EXPLAIN QUERY PLAN to make it clearer when a query uses the PRIMARY KEY index of a WITHOUT ROWID table.
FossilOrigin-Name: 9268df305b90ac11e44b3107bbab5becf38860b7
2014-05-23 17:17:06 +00:00
drh
43ae8f6f4d In the command-line shell, if three or more interrupt signals (control-c)
are received in a row without a response from sqlite3_interrupt() then
call exit(1) immediately.  This allows control-C to interrupt the shell
even if it is stuck in a computation or loop that does not involve the
VDBE.

FossilOrigin-Name: b5cde57166fd874d00dec23d3a59bf3a23979fc5
2014-05-23 12:03:47 +00:00
drh
e48ae7157a Make sure sufficient VDBE registers are allocated for an INSERT...SELECT
when there is an idlist on the insert table that includes an explicit
rowid.  Ticket [9654505cfda93610585fde5a9bbf2e730c8a8d5]

FossilOrigin-Name: 9a2dd18776cc7003752980be0a0920a8799e5f35
2014-05-23 11:48:57 +00:00
dan
6044f31d13 Add a test for the EQP output of a skip-scan query that uses the PK index of a WITHOUT ROWID table.
FossilOrigin-Name: 10238fad94a198c0639461645227b6c5ebe16eee
2014-05-22 09:58:45 +00:00
drh
c9bbb01180 Do not burn memory remembering CHECK constraints in a read-only database.
FossilOrigin-Name: 34ddf02d3d21151b8099c0c25706530a03d93887
2014-05-21 08:48:18 +00:00
drh
781597feca Fix the sqlite3_db_readonly() API so that it reports true if the database
is readonly because the file format write version (byte 18 of the header)
is too large.

FossilOrigin-Name: 8d8af114dac301335ec10671c1e9a5a6d8266a60
2014-05-21 08:21:07 +00:00
drh
cb6effafec Improvements to the testability of the threads.c module.
FossilOrigin-Name: 386e088868b44b02646e452147838d2e97b093ee
2014-05-20 19:11:50 +00:00
drh
de823bedef In vdbesort.c, change the names of PmaReader variables "pIter" to "pReadr".
Other related comment changes.  The generated object code should be the same.

FossilOrigin-Name: 99efb235a08784020535a770d7e7d96d9ccee12d
2014-05-20 11:03:53 +00:00
drh
db2f91907d Merge recent changes from trunk.
FossilOrigin-Name: 6eefdad946da6a5f4052ac51d327777890fa3f18
2014-05-19 23:17:33 +00:00
dan
27f2468422 Internally, use a 64-bit integers for segment level numbers.
FossilOrigin-Name: 8180e320ee4090e41511836678e49a98c0b228e8
2014-05-17 16:56:52 +00:00
dan
83e05b814e Fix a broken test case in fts4growth2.test.
FossilOrigin-Name: 9fde5b960af39b187474e5b2909ff0e56d5e0bf9
2014-05-17 15:10:37 +00:00
mistachkin
02c1e264a9 Fix harmless compiler warnings.
FossilOrigin-Name: 7e60347e21a7473974061965a8d1f2eadde987e2
2014-05-16 23:38:59 +00:00
mistachkin
77a90ce811 Work around compilation issue with MSVC.
FossilOrigin-Name: 9623a29c11e3a90513016ea3306c085d2bf91b62
2014-05-16 23:15:50 +00:00
drh
5f4a479048 Rearrange some conditionals and add #if statements to make the code more
testable.

FossilOrigin-Name: 17afd77057f8695733a9a60225646c1d8813b1a0
2014-05-16 20:24:51 +00:00
drh
190d695967 Add a pair of sqlite3FaultSim(100) calls to vdbesort.c to facilitate testing
of obscure and hard to reach error conditions.

FossilOrigin-Name: cceac14fd83ddd8f868c1767cdc66635607cb159
2014-05-16 17:31:42 +00:00
dan
4bd855fae5 Fixes to prevent an FTS index from growing indefinitely as the corresponding table is updated. Change the FTS 'automerge' option to allow the user to specify the number of segments that should be merged simultaneously by auto-merges.
FossilOrigin-Name: a75f1800021d30b712053373440041b7b355a36a
2014-05-16 16:16:59 +00:00
dan
e82384817d Add extra test to backcompat.test to ensure that old and new versions of FTS may work together on the same incremental merge operation.
FossilOrigin-Name: 3997d47bb9c8593a2cd30317ea65163b99db1832
2014-05-16 15:48:17 +00:00
drh
d25c69ef39 Merge all recent changes from trunk, and especially the new sqlite3FaultSim()
interface.

FossilOrigin-Name: 43fcbd9116401f30781fdcbe55d1674d6b96311b
2014-05-16 14:27:05 +00:00
drh
c007f61bb0 Repurpose the SQLITE_TESTCTRL_FAULT_INSTALL test-control to register a
callback to be invoked by sqlite3FaultSim().  That test-control has been
unused since 2008-06-20 and was never used in any official release.

FossilOrigin-Name: 0d43a7ad9abe821e33e0bf83a997aa4461b1e3f2
2014-05-16 14:17:01 +00:00
drh
8f0dab37cb Use #ifdef logic to avoid an always-true branch when
SQLITE_MAX_WORKER_THREADS=0

FossilOrigin-Name: 88cfe6d7de5f19f484304d0db585eac5de6c00ae
2014-05-16 12:18:08 +00:00
dan
a7b9e7d2d9 Fix a bug causing an incorrect segment size value to be stored if both an old and new FTS version performed work on the same incremental merge operation.
FossilOrigin-Name: a9a2aeab298ba2ac0b8835e61406e2d83bf7e39b
2014-05-16 10:30:44 +00:00
dan
df2c52f728 Merge latest trunk changes with this branch.
FossilOrigin-Name: 5809986ffcc5d9cbab64760f8d7fbfbb6b626ee7
2014-05-15 19:05:55 +00:00
dan
157c957a65 Fix a problem with the handling of delete markers by automerge on large databases.
FossilOrigin-Name: 2b09bd17eb85ea3c682e930d2aabc6441f2265e0
2014-05-15 18:36:39 +00:00
drh
6cc3759383 Use #ifdef to omit code that is not used when SQLITE_MAX_WORKER_THREADS is zero.
FossilOrigin-Name: 2e8d287d4f41d395a488bf65b20e956b0e311177
2014-05-15 16:56:56 +00:00
dan
5b34f15a82 Do not search for promotable segments following an FTS 'optimize' operation or creation of a new segment on the oldest existing level.
FossilOrigin-Name: 34f6b4b8e4cb8ea45fd518672dc96335d1ce06ab
2014-05-14 19:49:17 +00:00
dan
a0b7ca90b7 Fix a problem to do with loading the value of the FTS automerge setting from the database.
FossilOrigin-Name: 7268119f74602929b372b88eca7b3c3b4964f7d5
2014-05-14 18:45:27 +00:00
dan
9e83e465eb Fix various problems to do with segment promotion. Add test file fts4growth2.test, containing tests to check that the FTS index does not grow indefinitely as the table is updated.
FossilOrigin-Name: 21491a9bc686e63bec32f1a67103622f1160a2f9
2014-05-14 15:58:47 +00:00
dan
c0caea21de Fix a problem preventing delete markers from ever being removed from the FTS index.
FossilOrigin-Name: 7f47ae5c5ddb1227484ddae7c6960183932a052a
2014-05-13 20:11:37 +00:00
mistachkin
a5e2b50d0a Improve a comment in the MSVC makefile. No changes to code.
FossilOrigin-Name: 0901dccedaf5679691ba803ec76d113de170185d
2014-05-12 22:36:50 +00:00
mistachkin
548ff8f491 Add VSIX packaging support for Windows Phone 8.1 using Visual Studio 2013 Update 2.
FossilOrigin-Name: 013738f3d531078fb47f9992c18a0d630e771a32
2014-05-12 21:12:04 +00:00
dan
6bb9889ef0 Experimental code to prevent FTS indexes from growing indefinitely as the table is updated.
FossilOrigin-Name: b3b505a4dd0c679437a4272109f1188175088cd1
2014-05-12 20:04:48 +00:00
mistachkin
0f710546e7 In mutex_w32.c, make inclusion of the Windows header file dependent on SQLITE_OS_WIN, not SQLITE_MUTEX_W32.
FossilOrigin-Name: 93ffbcc0b1d207950851dbb16a8c101afb949d5f
2014-05-12 15:37:03 +00:00
drh
b0f935e4da In the sorter, only use large memory allocations if scratch memory has not
been configured.  Add #ifdefs to disable unused code when 
SQLITE_MAX_WORKER_THREADS is zero.  Other sorter changes in support
of testability.

FossilOrigin-Name: d7e2b0d9cb099eda3341bc934bedff9facfe88bd
2014-05-12 15:30:00 +00:00
mistachkin
796407395e Merge updates from trunk. Emit the AppliesTo and DependsOn SDK manifest attributes when building the VSIX for Windows Phone 8.1.
FossilOrigin-Name: f6237a5f190bd5693ceed0ca1f048c3ec2a4da67
2014-05-10 17:33:11 +00:00
mistachkin
1273614191 When using Visual Studio 2013, add the appropriate MaxPlatformVersion attribute to the VSIX SDK manifest.
FossilOrigin-Name: 0a4f59676bd0ab33b2c86c9a35a2ebbdbaf09ee7
2014-05-10 17:28:45 +00:00
mistachkin
d9b3c549b3 Further MSVC makefile changes to support Windows Phone 8.1.
FossilOrigin-Name: a9c81815e1b7a9c05da61f75edac45cb1a954135
2014-05-09 23:31:55 +00:00
mistachkin
52c40a89bb Merge updates from trunk.
FossilOrigin-Name: f4fea7bb8a4b118bdceff400a6c49c6291c0d58e
2014-05-09 20:54:07 +00:00
mistachkin
4712c21287 When cross-compiling with the MSVC makefile, make sure the correct library path is used. Also, keep track of the required compilation options separately.
FossilOrigin-Name: c3dce2e7390eec3a337be1b99f80ad5f721cc647
2014-05-09 20:51:17 +00:00