Commit Graph

4043 Commits

Author SHA1 Message Date
drh
74358f0c77 Add a test case that demonstrates ticket [71e333e7d2e642].
FossilOrigin-Name: cc6e0785df3c2342376351e19ba7dba7b8d2f6a3
2012-12-06 15:15:15 +00:00
mistachkin
f44d4b41bd Bring the ancient malloc3.test file closer into relevance with the latest core code.
FossilOrigin-Name: 9793a21c13a1188383b4be64df86629f196ca330
2012-12-06 04:19:24 +00:00
dan
e825831ee4 Disable a couple of tests in where.test when running the "no_optimization" permutation.
FossilOrigin-Name: 5e961e37c5357776bcb44c473cb5ee4b59561f07
2012-12-05 19:04:32 +00:00
dan
97305a7ccb Modify a query in test/thread001.test to ensure that results are returned in the order expected by the test.
FossilOrigin-Name: 51cbddd51d02bcd954be411ecc83556c049a2680
2012-12-05 16:44:13 +00:00
dan
9ccaefb172 Fixes to a test case in shared_err.test. The fix is to prevent sqlite3_prepare() from being called when the test intends to test the response of sqlite3_step() to an OOM condition.
FossilOrigin-Name: 40c143955ebe75f8e73119f9103f36a3c8ac4514
2012-12-05 14:37:55 +00:00
dan
8411b25c59 Update a couple of test scripts so that they work in auto-vacuum mode.
FossilOrigin-Name: 04ab2dc6914e4d6fe2682eba08fc1cd1148a44a1
2012-12-05 09:12:58 +00:00
dan
ec6b07b27b Add a test to ensure that the fix in [b0c1ba655d] has worked.
FossilOrigin-Name: 41806de5c88e924e306ca737192755c011517426
2012-12-04 05:24:21 +00:00
mistachkin
585dcb251b Improvements to the 'tcl' shell output mode. Escape double quotes, set separator to space when mode is set, and skip separator after final column.
FossilOrigin-Name: 41fd9dd29034b2269e4b7f2626350124d37b5303
2012-12-04 00:23:43 +00:00
dan
bba44d0d1b Fix a problem causing the "number-of-documents" field maintained by FTS4 to be set incorrectly.
FossilOrigin-Name: e38fb02d5ea5daa6992df4dfbbeec92bf7b525f6
2012-11-27 15:56:38 +00:00
drh
0fbb50ee15 When available, use posix_fallocate() rather than ftruncate() to allocate
space for mmap()ed -shm files, since posix_fallocate() gives an error if
no disk space is available whereas ftruncate() is silent and leaves the system
vulnerable to a SIGBUS upon first write to the mmap()ed region.
Ticket [5eaa61ea1881040b17449ca043b6f8fd9ca55dc3]

FossilOrigin-Name: 356259617cfad04492a02912fdf781f54a2b4494
2012-11-13 10:54:12 +00:00
dan
9fc5b4a539 Change os_unix.c to propagate ENOENT errors back to sqlite as SQLITE_IOERR_DELETE_NOENT. Have SQLite ignore these where they are benign and propagate them back to the caller where they may indicate a file-system malfunction of some description.
FossilOrigin-Name: bed9c172ce624ab7b5b9de9ad42444891717ad9a
2012-11-09 20:17:26 +00:00
drh
782d68a4cd Try to take into account the cost of inner loops when selecting which table
of a join to use for the outer loop.

FossilOrigin-Name: 942556342a332b04a11169bb04f387d741ef9488
2012-11-09 17:59:26 +00:00
drh
24aeee17a1 Add the INSTR() SQL function.
FossilOrigin-Name: a4c181cbcf9b8baa6e07501a93ef81603d91ba7d
2012-11-05 13:51:58 +00:00
drh
e0b2d5dabb Adding test cases for ticket [bfbf38e5e9956a]
FossilOrigin-Name: 62ebfa747635a5593759ea2a28166d054c8eee8a
2012-11-02 19:08:31 +00:00
drh
21172c4cc0 Add an optimization that attempts to run a subquery as a coroutine rather
than manifesting it into a temporary table.

FossilOrigin-Name: 7af3acbbd49a2114fcdada9ec907c68ba9b053bd
2012-10-30 00:29:07 +00:00
dan
e62c0694de Fix a bug in fts3 causing it to return SQLITE_NOMEM when NEAR, OR and some auxiliary functions were used together. Also a segfault in vtab.c that could follow an OOM condition.
FossilOrigin-Name: 33f4f9817e8b3cb97ce02a4c49bd586332da37b2
2012-10-25 19:25:39 +00:00
drh
98d312fc3e Improvements to the command-line argument parsing in the
command-line shell.  Command-line options can now occur either before
or after the database name and first command and are still accepted and
processed.  Command-line options are processed even if no database name
is given (and :memory: is assumed).

FossilOrigin-Name: 317c80cba3688a97ade9cde622cc3bd94cf3436a
2012-10-25 15:23:14 +00:00
drh
d55e07296b Implementation of the INSTR() SQL function, as found in SQL Server, MySQL,
and Oracle.

FossilOrigin-Name: 49ccae964f3a8ae5aab87f56503121e09424545f
2012-10-25 03:07:29 +00:00
dan
1e3e41858f Add a test for the problem fixed by [bf44d73d3e].
FossilOrigin-Name: db9b1fa5973d79e29885817d5aedc3a886c2589a
2012-10-17 16:20:36 +00:00
dan
7eb0575287 Fix a failing assert() in wal.c.
FossilOrigin-Name: 8745530b9a877db77fe2ca3ea9c6bc99ce033055
2012-10-15 11:28:24 +00:00
mistachkin
06befd1e09 Modify backup4 test name prefix to make the resulting test names unique.
FossilOrigin-Name: 637fb1c1b7642ba3a404dde32e40d4a4ad16fe14
2012-10-13 20:20:09 +00:00
dan
b483eba051 Ensure that when the source of a backup is a database that is zero bytes in size, the final destination database consists of at least one page. Truncating it to zero bytes is equivalent to zeroing the schema cookie and change counter, which can cause problems for existing clients.
FossilOrigin-Name: af5c9ee4a453f71c03f24ad08824ced6c1b97afb
2012-10-13 19:58:11 +00:00
mistachkin
6292c01634 Fix duplicate test name in whereD.test.
FossilOrigin-Name: 1182b54af0fd43d5e6aa6399837e7915aa60a578
2012-10-10 13:59:11 +00:00
drh
90abfd086f Merge the fix for ticket [d02e1406a58ea02] into trunk.
FossilOrigin-Name: dd34bec389359845b86f4cc4906ab440f92dcab9
2012-10-09 21:07:23 +00:00
drh
3a17ea7ab6 Merge ORDER BY optimization refactoring and repair into trunk.
FossilOrigin-Name: c027a9af9137f3346dbb5c5e100a087c2e89797b
2012-10-08 21:51:58 +00:00
drh
2fad815c52 All test cases (veryquick.tcl and min.rc) pass. A few branch operations in
ORDER BY optimization logic are untested by min.rc.

FossilOrigin-Name: 8314fd6078a3a71aea9d6386ff277cfeb592b4ba
2012-10-08 21:01:15 +00:00
mistachkin
3038cfe90a Corrections to test names to eliminate duplicates and follow naming conventions.
FossilOrigin-Name: 50679889c75cd3205253b1682abfbddc5ff09175
2012-10-07 05:34:39 +00:00
dan
6b9bb59f82 Fix a problem in shared-cache mode where a COMMIT statement might cause a busy-handler belonging to a shared-cache connection other than the current writer to be invoked.
FossilOrigin-Name: e0c889d66ccf4af12cc77ac38c1e6477da63ac72
2012-10-05 19:43:02 +00:00
dan
a2ebe4b418 Add a test for the collation-sequence/CHECK constraint problem fixed by the previous commit.
FossilOrigin-Name: 82b6aa77c8d8de4c6fad1960f5958457a929a821
2012-10-05 17:18:16 +00:00
dan
41fb5cd103 Shared-cache mode fixes for views and virtual tables.
FossilOrigin-Name: 2b370dea704b59262c604af0efcef5660b194454
2012-10-04 19:33:00 +00:00
drh
325eff58d6 Update the query planner to recognize more cases where ORDER BY clauses
can be optimized out.  Add test cases to verify correct behavior of the
ORDER BY optimization when the covering-index-scan optimization is disabled.
Fix a harmless compiler warning in the TCL interface.

FossilOrigin-Name: 956e4d7f8958e7065ff2d61cd71519d6f4113d4a
2012-10-03 12:56:18 +00:00
drh
6f0e400cba Fix a query planner problem that only occurs when covering-index-scan is
disabled.  Fix to tests whose output changed due to the new and more
aggressive ORDER BY optimization.

FossilOrigin-Name: 0f9bb90100aa304a7f28023ca4173e68b445e8bd
2012-10-03 12:38:19 +00:00
drh
c45e67162d Fix the TCL interface so that SQL functions implemented in TCL honor the
"nullvalue" setting.  Also remove from the TCL interface some unused 
legacy UTF8 translation code left over from SQLite2.

FossilOrigin-Name: c1f10a2643179ec58f3879764e9e89676d4b5f91
2012-10-03 11:02:33 +00:00
drh
d663b5bdef Further attempts to optimize out unnecessary ORDER BY clauses.
FossilOrigin-Name: 6744d9a37faffed59b4d5cb96c8671ec46a87ea7
2012-10-03 00:25:54 +00:00
drh
afcd522af8 More lenient handling of ORDER BY optimization in joins with mixed ASC/DESC.
This is a better and less restrictive fix for the problem addressed by
the previous check-in.

FossilOrigin-Name: abcf6a5d054559ee5a093ba39180c47b4958d9cd
2012-10-02 15:19:19 +00:00
drh
178eb61c6b Only continue an ORDER BY optimization into inner loops if the equality
constraints on the inner loop match terms of an outer ordered index that
are actually used by the ORDER BY clause.

FossilOrigin-Name: b0e7b4df6c2a8c479f8d210bde50c737eaa248f0
2012-10-02 14:11:29 +00:00
drh
60441af4f2 Improved ORDER BY optimization when outer loops of a join return a single row.
FossilOrigin-Name: 62225b4a4c4bfe1820ef54cb202edf2cd866429f
2012-09-29 19:10:29 +00:00
drh
befda46598 Disable the bigfile tests on Macs.
FossilOrigin-Name: d869eddaf208c4bf03f6bd1848f510392f9dba49
2012-09-29 15:45:12 +00:00
drh
f784c1ede9 Query planner enhancements to be more agressive about optimizing out ORDER BY
clauses - in particular the query planner now has the ability to omit ORDER BY
clauses that span multiple tables in a join.

FossilOrigin-Name: 1e874629d7cf568368b912b295bd3001147d0b52
2012-09-28 00:44:28 +00:00
drh
a9e3fc05f5 Fix some corner case behavior in the new ORDER BY optimization logic.
Remove the SQLITE_OrderByIdx bit from the 
SQLITE_TESTCTRL_OPTIMIZATIONS mask, since enabling it caused many
TH3 tests to fail when the NO_OPT configuration parameter was engaged,
and since there really isn't any need to turn that optimization off.
The SQLITE_OrderByIdxJoin bit remains.

FossilOrigin-Name: 98b633717a1c9a08f6a1d00bc6bc891564ae7e9b
2012-09-27 23:27:23 +00:00
drh
5343b2d4a8 More test cases an bug fixes for the ORDER BY optimization of joins. All
veryquick tests now pass.

FossilOrigin-Name: 0d573320057b0903a5589cabfb1b1ece1c57958e
2012-09-27 19:53:38 +00:00
drh
6b10a6a7ed Test cases and bug fixes applied to the ORDER BY optimization for joins.
Some test cases fail, but except for the new orderby1.test failures, all
failures appear to be issues with the tests, not with the core code.

FossilOrigin-Name: 75cda864ededb6dc0f84bd52ed3311753a58e351
2012-09-27 17:31:32 +00:00
drh
cec320fb0e Merge the "PRAGMA busy_timeout" change into trunk.
FossilOrigin-Name: 1a679a1ef3b4f2d898c8cd83432d2b4c12bd93fa
2012-09-27 12:11:25 +00:00
drh
078b1fda34 Command-line shell enhancements: Added the ".print" command. Enhanced
the ".width" command so that negative widths will right-justify.

FossilOrigin-Name: a1d8269da3868e41a6603c1a683e324fe21fb317
2012-09-21 13:40:02 +00:00
drh
053a128f55 Tighter VDBE code for the WHERE_DISTINCT_ORDERED case of DISTINCT keyword
handling.

FossilOrigin-Name: 94b48064db3cbb43e911fdf7183218b08146ec10
2012-09-19 21:15:46 +00:00
drh
c35dfbb677 Merge the covering-index-scan optimization into trunk.
FossilOrigin-Name: ddd5d789e7ae4a66cd7b7fa79e48d2777f95350b
2012-09-19 00:35:31 +00:00
drh
dbaee5e342 Enhance IN processing to allow efficient use of indices with numeric affinities.
Add test cases for IN processing that would have spotted the error in the
[2be661a48023f4] check-in.

FossilOrigin-Name: 5ded9b68388f4024425c11f09b03529ac89454ce
2012-09-18 19:29:06 +00:00
drh
de9a7b8a94 Add the ability to disable the covering-index-scan optimization at compile-time,
start-time, or at run-time.  Add test cases to check this configurability.

FossilOrigin-Name: ccb8ecc30c8e6c7760131250297c2e452bbac43b
2012-09-17 20:44:46 +00:00
drh
3f4d1d1b02 Attempt to use a covering index even on a full table scan, under the theory
that the index will be smaller and require less disk I/O and thus be faster.

FossilOrigin-Name: cfaa7bc12847a7006ccc93815f2395ad5259744a
2012-09-15 18:45:54 +00:00
mistachkin
66498ae871 Fix WAL capability checking in one of the test files.
FossilOrigin-Name: 0ebe7cc57408d6d85910cc976fb8af4436d6e594
2012-09-13 16:12:20 +00:00