Commit Graph

13032 Commits

Author SHA1 Message Date
dan
e8fa8c9649 Fix a segfault in the streaming API functions triggered by a very long table name.
FossilOrigin-Name: d2642543eed54da1ac0f757d43dd4d72482eb752
2014-09-27 16:33:09 +00:00
dan
16228167c2 Improve sessions module documentation and comments. Fix some other code issues.
FossilOrigin-Name: bfc8bd80f8b225cebc66478448510ce84223ae7d
2014-09-27 12:26:18 +00:00
dan
fa29ecc4ed Fix a problem with concatenating patchsets containing DELETE and INSERT operations on the same row.
FossilOrigin-Name: 4d8537eafb40e3687abc057ba26a1f7014f2c2d9
2014-09-26 10:52:21 +00:00
dan
cbf6d2d2aa Add streaming version of sqlite3changeset_concat().
FossilOrigin-Name: 88eb6656bdb047a104837a2e15e7fe18c0a7a159
2014-09-25 20:43:28 +00:00
dan
fa122adac1 Add streaming version of sqlite3changeset_invert() to sessions module.
FossilOrigin-Name: 8ded6a46794c7bff1c8b790c662ba7e92f576380
2014-09-25 14:54:20 +00:00
dan
4757c65866 Add streaming version of sqlite3changeset_apply(). Tests and fixes for the same and sqlite3changeset_start_str().
FossilOrigin-Name: b917fc146876f764442de08d5ec36e5b4cf5ab52
2014-09-24 17:13:20 +00:00
dan
ef7a630496 Begin adding 'streaming' APIs to sessions module. This is a work in progress.
FossilOrigin-Name: 3c7d3d950bbf5f5ed3696ebc61c77ca48bafe2b5
2014-09-23 20:39:55 +00:00
drh
6b011d83b4 Merge all recent trunk changes into the sessions branch.
FossilOrigin-Name: 6406b77f2c447751a2fbb16f01c61cdcfd6af59e
2014-09-21 22:49:20 +00:00
drh
6656630b63 Correctly handle an ORDER BY clause on an outer query when applying
the compound-subquery flattening optimization.  Ticket [89398880bcfff].
Also add the SQLITE_ENABLE_SELECTTRACE option for additional debugging
and analysis information about select statement processing.

FossilOrigin-Name: d5880abd63c83c88e135257373afa0a3fd88297e
2014-09-21 22:31:52 +00:00
drh
d7643037e6 Add test cases for ticket [89398880bcfff9].
FossilOrigin-Name: 9683e001ed38b41979220eef0bdfcb54df5f3191
2014-09-21 20:31:26 +00:00
drh
249489331c Add the "showauth" extension in ext/misc.
FossilOrigin-Name: 28d52c1c38d849f099bc777f5987d1ef89680c2a
2014-09-21 17:51:37 +00:00
drh
eb9b884c2d Improved ".selecttrace" output.
FossilOrigin-Name: c0b61f7092a7fd2c5f51db26ce7a7a5c75c227fe
2014-09-21 00:27:26 +00:00
dan
7c0a4720ca Candidate fix for [d11a6e908f].
FossilOrigin-Name: 89398880bcfff96e91d2a9c45774f5fb3209ffc1
2014-09-20 20:38:48 +00:00
drh
9300adbc79 Fix the SELECTTRACE_ENABLE macro so that it doesn't cause problems for
testfixture.  Add new SELECTTRACE() calls.

FossilOrigin-Name: f1ba68f131d2f03e4a7bc50cde23a7609d384279
2014-09-20 20:24:49 +00:00
drh
abd4c72357 Enable SELECT query planning tracing when compiled with
SQLITE_ENABLE_SELECTTRACE and either SQLITE_DEBUG or SQLITE_TEST.

FossilOrigin-Name: cbe0cf9ddf46f0a678c85d49bfa74e3b7712e1a1
2014-09-20 18:18:33 +00:00
drh
af6f25aacc Fix the usage of the _GNU_SOURCE and _BSD_SOURCE macros in the main
internal header file, sqliteInt.h.  Set HAVE_STRCHRNUL to 1 by default on
Linux only.

FossilOrigin-Name: 59e2c9df02d7e988c5ad44c560ead1e5288b12e7
2014-09-20 00:35:05 +00:00
drh
4e7a479597 Only enable HAVE_STRCHRNUL by default on linux, as that is the only place
it appears to work by default.

FossilOrigin-Name: 0fac2c045f47c7735af4eb68ced81d8b43622a1f
2014-09-20 00:29:20 +00:00
mistachkin
33ac4c8bf5 Revise macro usage in 'sqliteInt.h'.
FossilOrigin-Name: 35db3e2f350ca2bc6bb9e1a647aec7f93bfb7065
2014-09-20 00:02:23 +00:00
drh
e7a3466458 Simplify two conditionals and add testcase() macros to the affinity transform
logic in the comparison operators.

FossilOrigin-Name: 544664cadfb4e504bc0b321c865d1ecb8a831e20
2014-09-19 22:44:20 +00:00
drh
1eda9f7d87 Recognize the invariant that a Mem object cannot be MEM_Dyn and have
a non-zero szMalloc at the same time.  Enforce this with assert()s and
exploit it in the sqlite3VdbeMemClearAndResize() routine for a performance
increase.

FossilOrigin-Name: 3b21cf2b284048da4b728a5d6ec89e5c330144d4
2014-09-19 22:30:49 +00:00
drh
11a6eee8e1 Tighten the conditions under which applyNumericAffinity() be called and add
assert() statements to prove that it is never called otherwise.

FossilOrigin-Name: e996ca32cb643c558b616c0dd872f3351b6aa3ef
2014-09-19 22:01:54 +00:00
drh
4583c37ca0 Fix the affinity on inserts into the ANALYZE tables. Change the affinity
characters to be upper case, to make the P5 parameter of comparison operators
easier to read.

FossilOrigin-Name: 3f3ca76aea38d566a574f4403b375bdac32854ed
2014-09-19 20:13:25 +00:00
drh
d74a90eab8 Do not attempt to extend the temp file if VFS version 3 is not supported and
hence memory mapped I/O is unavailable.

FossilOrigin-Name: 3ab20ba14f0204efeec62c7dbb87cb3f60e2497f
2014-09-19 19:43:20 +00:00
drh
142341cd23 Make the "nolock" VFS on unix a version-3 VFS so that the sorter can
use memory-mapped I/O.

FossilOrigin-Name: 3db78d6100a1ecf58c18eec3abefa7d1250c649c
2014-09-19 19:00:48 +00:00
drh
0c8f760ab3 Remove a local variable from the OP_Column implementation, resulting in a
modest size reduction and a performance increase.

FossilOrigin-Name: 6199760d1340858d97c845177986b783da915d9e
2014-09-19 16:56:45 +00:00
drh
069c23c947 Small size reduction and performance increase for releaseMemArray().
FossilOrigin-Name: 24cd32d681df58f687b2afbe4b13d579e3efdd4b
2014-09-19 16:13:12 +00:00
drh
7abda85607 Updates to comments. No code changes.
FossilOrigin-Name: 9b42c3da6b2593a10b8fe4b2fcc3d650132625c1
2014-09-19 16:02:06 +00:00
drh
7b5ebcaf26 The OP_Column opcode runs faster and is smaller by manually in-lining the
code that persists string values in the output register.

FossilOrigin-Name: 36b613ccf0ddb764af90841994da91b7fcaa8f00
2014-09-19 15:28:33 +00:00
drh
a5476e9254 Add the sqlite3VdbeMemClearAndResize() function. Fix a sorting-index
prefilter problem.

FossilOrigin-Name: 987a7a211913b3949da20e43423af376f72a28ba
2014-09-19 04:42:38 +00:00
drh
137fd4fda2 Make sure that the sorting-index pre-filter recognizes that a rowid reference
might be sortable.  This fixes a performance regression.

FossilOrigin-Name: 72727b68cd07969165f1f0943cc7e1a265436653
2014-09-19 02:01:37 +00:00
drh
322f2852f2 Add the sqlite3VdbeMemClearAndResize() interface to be used in place of
sqlite3VdbeMemGrow().

FossilOrigin-Name: 5b9b8987797abf7c68d2c3154f6657be9b8b1c8f
2014-09-19 00:43:39 +00:00
drh
17bcb10299 Add the Mem.szMalloc element to the Mem object and use it to keep track of
the size of the Mem.zMalloc allocation.

FossilOrigin-Name: 9c09ac353df6041808cace41880f4729ee73f5e1
2014-09-18 21:25:33 +00:00
mistachkin
26c79a060b Correct typos in comments. No changes to code.
FossilOrigin-Name: 55879932116d373c95a5f32ec44b53a9c3f4db24
2014-09-18 18:55:47 +00:00
drh
74eaba4de2 Merge the Mem.r value into the MemValue union as Mem.u.r. Hence, a Mem can
now store an integer or a real but not both at the same time.  Strings are
still stored in a separate element Mem.z, for now.

FossilOrigin-Name: 4c8c89d7e62aecfe2eb735f7bb114aed6b452847
2014-09-18 17:52:15 +00:00
drh
24a096297e Performance improvement for affinity transformations on comparison operators.
FossilOrigin-Name: d7afdcbac24350b73a30c06c45cf0f2122820e4f
2014-09-18 16:28:59 +00:00
drh
7ea31ccb01 Since numeric affinity is the most common case, check it first. Interchange
the NONE and TEXT affinity codes for easier checking of no affinity.

FossilOrigin-Name: 4ef4c9a7c8510203bce0941dda2f76ded8da1de2
2014-09-18 14:36:00 +00:00
dan
9675d5dabc Modify an assert() within sqlite3PagerWalFramesize(), a function only ever used by zipvfs, to account for recent zipvfs changes.
FossilOrigin-Name: 3bd7c1b2faa2d4cc95b255633204006849bfd5e0
2014-09-18 09:59:28 +00:00
drh
20f3df046a Fix harmless warnings on 32-bit MSVC builds.
FossilOrigin-Name: 5192f964b2a85459553f1cea741b9791606ccc4e
2014-09-18 02:20:54 +00:00
drh
760b15984b Make sure of the strchrnul() library function on platforms where it is
available.

FossilOrigin-Name: ef1aa10b7f54912cba71cd0a98c5055d501de54f
2014-09-18 01:50:09 +00:00
drh
9031494af2 Merge micro-optimizations into trunk after fixing the build on MSVC.
Performance now shows 7.58% faster than the 3.8.6 release on x64 with
gcc 4.8.1 and -Os.

FossilOrigin-Name: 1de558bcb13edc4e9a42a0b05e4b0ed6b14286a4
2014-09-18 01:29:11 +00:00
drh
3329a63ac5 Fix compiler warnings and change the nullMem structure initializer into a
format that MSVC can understand.

FossilOrigin-Name: 163bfae8583b2d3002a3a43d6bf8a66fefd73acb
2014-09-18 01:21:43 +00:00
drh
ca5506bdc4 Performance improvement and slight size reduction to the comparison operators
in the VDBE.

FossilOrigin-Name: 14052a7d088bed8196d90a3361ce717a5193bdc8
2014-09-17 23:37:38 +00:00
drh
d3b74200a8 In the Mem object, stop requiring that Mem.xDel be NULL when the MEM_Dyn
bit is clear.  Also reduce the amount of initialization of Mem objects.
All for a small size reduction and performance increase.

FossilOrigin-Name: fdddb477c89dabb9f7bf2d5ccb32534868df3a03
2014-09-17 16:41:15 +00:00
drh
0725cabe3a Improved interface to the Mem object handling. Small size reduction and
performance increase.

FossilOrigin-Name: 4e437844322cc20eef92928b53fa6b37eded586e
2014-09-17 14:52:46 +00:00
drh
6b478bcd9e Continuing cleanup of memory register memory allocation handling.
FossilOrigin-Name: 2598aedc5dd2bac67e2e518a31f2803e469c2ba6
2014-09-16 21:54:11 +00:00
drh
8740a60016 Make sure registers are cleared properly prior to being used to store
the result of an OP_Column operator.

FossilOrigin-Name: 78fb8838d80b229418c347c63579989432e1af7d
2014-09-16 20:05:21 +00:00
drh
2a2a696cd7 Simplification of the OP_Column logic for the case of rows with overflow.
FossilOrigin-Name: f73678038d8fc399c1ca55230ae45962007c909c
2014-09-16 18:22:44 +00:00
drh
897a2d50f2 Remove an unused parameter from sqlite3VdbeIdxRowid(). This is cosmetic
only as the C-compiler optimizers were already omitting this parameter on
amalgamation builds.

FossilOrigin-Name: a10a6bba4963761b490b7243b388dcc920c4cfed
2014-09-16 14:55:08 +00:00
drh
75179ded97 Reduce the number of arguments to RecordCompare functions from 4 to 3,
resulting in a small performance increase.

FossilOrigin-Name: 8239c35aedd583af79505378bb7dbb78346a3f45
2014-09-16 14:37:35 +00:00
drh
035e563bf6 Reorder the elements of the Mem object for a small size reduction and
performance improvement.

FossilOrigin-Name: 0be3019ed794c10de67dfd645ceea7d45815bc4b
2014-09-16 14:16:31 +00:00