Commit Graph

12416 Commits

Author SHA1 Message Date
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
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
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
a7f37491a7 Enhancements and updates to the Win32 mutex subsystem.
FossilOrigin-Name: ca9868cdae19045dc522490b34dee0f14d928ebe
2014-07-29 19:54:03 +00:00
mistachkin
edd93c3349 Merge updates from trunk.
FossilOrigin-Name: 08c9a4ea6353900095a471365a8611a443f5f399
2014-07-29 18:03:36 +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
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
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