Commit Graph

12738 Commits

Author SHA1 Message Date
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