Commit Graph

12809 Commits

Author SHA1 Message Date
dan
4ee3eb0ad4 Add a test to show that the change on this branch is effective.
FossilOrigin-Name: fc619be057975b8be6d0958024c5d436edbdf084
2014-10-04 10:22:01 +00:00
drh
75b170b164 Avoid leaking Index.aiRowEst memory if an OOM causes a rollback which deletes
the index before the aiRowEst deletion code in sqlite3AnalysisLoad() routine
has a chance to run.  Since the aiRowEst now might be deleted from freeIndex()
which does not always have a db pointer, make sure the aiRowEst memory is
not held in lookaside.

FossilOrigin-Name: efd87ba142723ba131fcc985db6eb45c5a3c637b
2014-10-04 00:07:44 +00:00
dan
0c1a18b294 Fix a division-by-zero error that might occur if the sqlite_stat1 table is corrupt.
FossilOrigin-Name: f9c053b23ece877a7fdbe82204a10592f2d24a2d
2014-10-03 19:29:39 +00:00
dan
43085d7425 Improve the accuracy of the estimates used when searching an index for values not present in any stat4 samples under some circumstances.
FossilOrigin-Name: e6f7f97dbc677c9f01b23142928c3fa7307c2fba
2014-10-03 19:16:53 +00:00
drh
79f7af9a9e Add requirements marks on the sqlite3_db_status() interface implementation.
Fix a typo in the documentation.  Fix the new sqlite3_result_text64() routine
so that it works correctly with an encoding parameter of SQLITE_UTF16.

FossilOrigin-Name: d2fc322728331ae2d147c8496129df5e3c655eb5
2014-10-03 16:00:51 +00:00
drh
8da47419dd Update to requirements marks related to changes in the memory allocation
interface and enhancement of the documentation regarding DEFAULT clauses
in CREATE TABLE.

FossilOrigin-Name: 440705b98a3429b830ea85e71cc1e414bc6d8058
2014-10-03 14:54:47 +00:00
drh
2a3d1d17fd Avoid a NULL pointer deference when processing the IS operator if the
right-hand side is an illegal "#ID" style variable.
Fix for ticket [8c32a33a53092c85a15b]

FossilOrigin-Name: ffe7573636c8057614b02f0a85559e1857fd04e4
2014-10-02 21:52:35 +00:00
drh
ccaba81e26 Show the TK_DOT operator in the TreeView debugging output.
No changes to production code.

FossilOrigin-Name: 07c89940c49a5dca3205a4b6fa8290f23bcb6e10
2014-10-01 13:17:34 +00:00
dan
9501a64516 Avoid ever writing before the start of an allocated buffer in the DIRECT_OVERFLOW_READ code. Fix for [e3a290961a6].
FossilOrigin-Name: c3c15d20c6913811956a5041c959a56ca4eeb5eb
2014-10-01 12:01:10 +00:00
drh
b08cd3f345 Improvements to the new syntax-tree output routines: Omit the "END SELECT"
mark and instead terminate the graph at the last item.  Increase the maximum
tree depth to 100.

FossilOrigin-Name: 5ce05757aac80b99c3b2141cd301809f8e28e661
2014-09-30 19:04:41 +00:00
drh
36be4c49e4 Enable the query planner to deal with WHERE clauses that have OR terms
nested within AND terms that are nested within OR terms.  Also remove an
unused function declaration.

FossilOrigin-Name: b6b289182f6590288ebc7b9efbcb29b6b4480538
2014-09-30 17:31:23 +00:00
drh
0a99ba3bc8 Further enhancements to the "wheretrace" debugging output.
FossilOrigin-Name: 670993eb8113f386cb2cb8b1507917f6da3b4d98
2014-09-30 17:03:35 +00:00
drh
5265149c0d Enhanced debug output for OR-logic in the query loop optimizer.
FossilOrigin-Name: 2e375eae473e4a9f2e7870d59e22ba39051ecbce
2014-09-30 14:14:19 +00:00
drh
c90713d3d2 Show tree diagrams of data structures in the debugging output when the 0x100
bit is set on sqlite3WhereTrace or sqlite3SelectTrace.

FossilOrigin-Name: 92e0b4bd4d75e8b000586e51a07b3e181d9af20b
2014-09-30 13:46:49 +00:00
drh
4fa4a54f7e Remove the SQLITE_ENABLE_TREE_EXPLAIN compile-time option. Add alternative
debugging display routines: sqlite3TreeViewExpr(), sqlite3TreeViewExprList(),
and sqlite3TreeViewSelect().

FossilOrigin-Name: 4ff51325d6b41d0c59e303b573700ec80c51d216
2014-09-30 12:33:33 +00:00
drh
39c4b82b5a Fix the header comment in sqlite3VdbeDeletePriorOpcode(). No changes to
code.

FossilOrigin-Name: 7fb1626866c2f8dad84c7e6184824be3efd71ca2
2014-09-29 15:42:01 +00:00
drh
7682a476f6 Ensure that the OP_Prev opcode verifies that content has not been deleted
out from under the cursor.  Fix for ticket [209d31e3161b9e9ff].

FossilOrigin-Name: 414f0d6a647a4d040b5463c73c5e15e699d85b4c
2014-09-29 15:00:28 +00:00
mistachkin
843e4cdea9 Add an assert() to verify the last-row-id for the database just prior to calling a SQL function.
FossilOrigin-Name: d026f0c944ce812732d3595eaa3c5d432a86c7dd
2014-09-26 18:30:11 +00:00
drh
867db83159 Fix the "PRAGMA integrity_check" command so that it avoids formatting error
message context messages until it actually needs to generate an error message.
This avoids much formatting, and hence greatly improves the performance of
"PRAGMA integrity_check" in the common case when there are no errors.  It also
makes the code a little smaller.

FossilOrigin-Name: 83913515830aa850f9e38406f9422d7e88dcab66
2014-09-26 02:41:05 +00:00
drh
3b130beb15 If an SQL function makes a recursive call to do an INSERT into the same
database, make sure that the last_insert_rowid() for that INSERT is recorded.

FossilOrigin-Name: e93aecc090c2a1d3c231bb2bde044886eff0bdf7
2014-09-26 01:10:02 +00:00
drh
d863346194 Minor code reformatting and comment change, to improve clarity.
No logic changes.

FossilOrigin-Name: baeb72a356d73e6f624edacd2986ab766105e177
2014-09-25 17:42:41 +00:00
drh
a15cc47f81 Simplifications to the SQL function and aggregate calling procedures.
FossilOrigin-Name: 3467049a1705b49905ea88a5c6becb6fe318f2fa
2014-09-25 13:17:30 +00:00
drh
2c4dc635a1 Simplification to the random rowid picking logic that begins running when
the maximum possible rowid has already been used.

FossilOrigin-Name: 1330c72e172324c68ab49e5bb2ceba985935ae01
2014-09-25 12:31:28 +00:00
drh
9fdfdc893b Still more performance enhancements to the LIKE and GLOB operators.
FossilOrigin-Name: 6c8924cacc2b875270770fed2cc3b1884f57a655
2014-09-25 11:08:57 +00:00
drh
88b3322f27 More performance optimization for the LIKE and GLOB operators.
FossilOrigin-Name: 5ab1023d6cfe31fa8a194804b8216058977ac973
2014-09-25 03:51:37 +00:00
drh
97348b37c2 Change that might allow SQLite to build and work using the EBCDIC character
set.

FossilOrigin-Name: ef30e0352b3d4a29749cd0872c10e45a6649ec52
2014-09-25 02:44:29 +00:00
drh
328d913cbd Size reduction and performance improvement in the LIKE and GLOB operators.
FossilOrigin-Name: b2c89ef49cd19b8031a8149a2dc47cea07dd04e0
2014-09-25 00:56:00 +00:00
drh
3fbb022b98 Have each open database allocate its pTmpSpace when the first write cursor
is opened, rather than on each insert or delete, for a small space savings
and performance boost.

FossilOrigin-Name: 99323552c001bc9173eb2a44542234c8ef7a9845
2014-09-24 19:47:27 +00:00
drh
b2325b72df Small performance and size optimization for btreeUnlockIfUnused().
FossilOrigin-Name: 13c746f85d254475b10c3dd58555acd3bbead0ce
2014-09-24 18:31:07 +00:00
drh
feada2df39 Do not allow parameters in a DEFAULT clause of a CREATE TABLE statement.
Ticket [78c0c8c3c9f7c1].

FossilOrigin-Name: 1ad2bc1ed4c4ac81ac67a9660761f0eeb47c7fef
2014-09-24 13:20:22 +00:00
drh
9bfdc25062 Have the clearCell() routine return the cell size to the caller, rather
than have the caller make a separate call to cellSizePtr().

FossilOrigin-Name: f21d217583c205dc17f98bb4877fd4ed98cefcb1
2014-09-24 02:05:41 +00:00
drh
3f3874030c Shorten all lines of source code in btree.c to at most 80 characters.
No logical changes.

FossilOrigin-Name: 5dd41cdbfebdd088ebd9a90a394ee296c207ad90
2014-09-24 01:23:00 +00:00
drh
3e28ff5cb5 Add the MemPage.noPayload boolean and use it to help
cellSizePtr() and btreeParseCellPtr() run faster.

FossilOrigin-Name: 8e3375313ebbf26b68561f3ed31d2a488222e5d0
2014-09-24 00:59:08 +00:00
drh
c46838309c Remove an unused C-preprocessor macro. No functional changes to the code.
FossilOrigin-Name: f480582ccae0e9a917d4523191025bd16016ba64
2014-09-23 23:12:53 +00:00
drh
6200c88123 Avoid calling btreeParseCellPtr() from within fillInCell() since most of
what btreeParseCellPtr() computes is ignored by fillInCell().  Instead, have
fillInCell() compute the values it needs inline.  Performance improvement.

FossilOrigin-Name: 4147f6671e3faa8ddffab8387a6c7d9b5b962fc8
2014-09-23 22:36:25 +00:00
drh
ab1cc58b70 Simplify the CellInfo structure for a size reduction and performance
improvement.

FossilOrigin-Name: bf59df66b3613c38cfb13a68091b8328ebb22c78
2014-09-23 21:25:19 +00:00
drh
3b8fea9ec6 Add the "multiplex_truncate" PRAGMA to the multiplexor extension, for
querying and setting the truncate flag on a database connection.

FossilOrigin-Name: d2962a5f388f30a02429e0c8b87399f482b5604c
2014-09-23 18:30:00 +00:00
drh
14f0e2128a Adjust skip-scan cost estimates slightly so that a full table scan is
preferred over a skip-scan to a column with only two distinct values.

FossilOrigin-Name: ae9a42b268ad3f7d21a5813bb931e795c6917014
2014-09-23 01:40:59 +00:00
drh
a4bb5b0726 Fix to payload size overflow detection in the cellSizePtr() change of
the previous check-in.

FossilOrigin-Name: 7609744014c6a84a8379794a0351a2e9626ec86b
2014-09-22 20:38:10 +00:00
drh
dc41d60aaa Size reduction and substantial performance increase for cellSizePtr().
FossilOrigin-Name: bc8bbf3207288d160287519c3b7123997996b440
2014-09-22 19:51:35 +00:00
drh
7e07433fe7 Tune the query planner to be more aggressive about using automatic indexes
on views and subqueries for which there is not opportunity to declare a
persistent schema index.

FossilOrigin-Name: 41de1643bfc9ae25e20790d707e2789b665baa2b
2014-09-22 14:30:51 +00:00
drh
d9f9441d7d Disable shared memory operations using the unix-nolock VFS.
FossilOrigin-Name: 10a6e510497b471d67ac3dfb19ff256a7d18adf4
2014-09-22 03:22:27 +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