1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-21 09:00:59 +03:00
Commit Graph

13138 Commits

Author SHA1 Message Date
drh
2cf4acbd9f Add the SQLITE_TESTCTRL_BYTEORDER test control to interrogate SQLite's notion
of the processor byte order and whether the byte order is known at compile-time
or determined at run-time.

FossilOrigin-Name: 9c6961967ae00e563ebe2859eaf2639a79f2cb01
2014-04-18 00:06:02 +00:00
drh
1821cbacf1 More test cases with very long priority queues.
FossilOrigin-Name: 71692aa97c78676f0ba80eaeec0ad9ac225f4427
2014-04-17 15:34:58 +00:00
drh
b640595f97 Test cases and bug fixes for the sqlite3_rtree_query_callback()
mechanism.

FossilOrigin-Name: 1ccaaed6b516ec2ce953c1b31025a82ba76d00e7
2014-04-17 14:52:20 +00:00
dan
a9f43d735b Fix build problems in vdbesort.c. Add further comments and changes to make things easier to understand.
FossilOrigin-Name: 12b190db1d20c34390c768614b40ff58a9d3b74c
2014-04-17 08:57:17 +00:00
dan
31a0bfde9b Clarify the purpose of the nField argument passed to sqlite3VdbeSorterInit().
FossilOrigin-Name: c0c8cff17b7311bbc4fd081313a5552f927c3833
2014-04-16 19:04:23 +00:00
dan
db30fc4ff2 Change the name of vdbeIncrInit2 to vdbePmaReaderIncrInit. Add a header comment to the same function.
FossilOrigin-Name: 6622d87675c1d7992b1e6d52ae7da1007a1568a4
2014-04-16 17:41:22 +00:00
dan
7f0a24b7bf Rework the way trees of MergeEngine objects are built in vdbesort.c to make it easier to follow. Fix memory leaks that could follow an OOM or IO error. Add various comments to explain functions in vdbesort.c.
FossilOrigin-Name: 69026ec7dc3bd3e33bbe17c221a53cf1dd0f8945
2014-04-16 16:43:05 +00:00
dan
22ace89179 Fix some problems to do with OOM conditions in vdbesort.c. Some problems remain.
FossilOrigin-Name: 2f94f9ce9bf11f1599bbc640b3fc8c15da588416
2014-04-15 20:52:27 +00:00
dan
1a088a8ef5 Fix further code and documentation issues in vdbesort.c.
FossilOrigin-Name: d03f5b8622d304f029f73c7cd0bee3182a81d081
2014-04-15 19:52:34 +00:00
drh
65b9ac5224 Make sure the undocumented sqlite_rename_parent() function does not
crash even if it is invoked with NULL arguments.
Ticket [264b970c4379fd4b94]

FossilOrigin-Name: c6fa8d0d82805be230f672eabccdfa5680d4ddfd
2014-04-14 19:48:25 +00:00
dan
f77ceba594 Improve performance in single-threaded mode by having the final merge pass keys directly to the VDBE, instead of going via a final PMA.
FossilOrigin-Name: 02610cd9b77caa2c181210056088beb3ad6ce30f
2014-04-14 18:41:21 +00:00
dan
92a20dde1f Minor fixes so that builds with SQLITE_MAX_WORKER_THREADS=0 work.
FossilOrigin-Name: e400bbbf26cdfe88f6cb231e96cdcddb9a6bcc0f
2014-04-14 08:45:32 +00:00
dan
be3018c18f Improve use of multiple threads in sqlite3VdbeSorterRewind().
FossilOrigin-Name: e1bdc4b810907cc0e55e0c923c8ebc777068cfe0
2014-04-14 07:30:39 +00:00
drh
d249090450 Remove the unused second argument from sqlite3ExprCachePop(). Add an
ALWAYS() on an always-true conditional in sqlite3VdbeResolveLabel().

FossilOrigin-Name: ab23abf392175d3e256ff619b13abbbe732a49ed
2014-04-13 19:28:15 +00:00
drh
87744513e7 Make sure column cache elements are cleared correctly when jumping over
code for key generation in a partial index. 
Fix for ticket [2ea3e9fe6379fc3f6].

FossilOrigin-Name: 3122b8364082be783821da01d4af2af6a9586327
2014-04-13 19:15:49 +00:00
dan
82a8a9f120 Fix many issues with new code.
FossilOrigin-Name: 62c406a042d7246f6df6b943421182a88483b2e3
2014-04-12 19:34:44 +00:00
drh
0ccb6cdc87 Continuing clean-up of the R-Tree module in preparation for cutting in the
new generalized query mechanism.

FossilOrigin-Name: 66c858f20586424e15d0bfa3d7b56643bde66226
2014-04-12 17:44:00 +00:00
dan
4be4c406fa Avoid having the sorter merge too many PMAs at a time when incrementally merging data following a SorterRewind().
FossilOrigin-Name: 98bf0307b121b0776a7170108cc8d3f948a7ebfe
2014-04-11 19:43:07 +00:00
drh
d83cad235a Modify the OR-clause handling so that it can safely deal with OR-clause
with 17 or more terms.  Fix for ticket [10fb063b1179be53ea0b53bb].

FossilOrigin-Name: a67b5312f63909737c052fe58ab5772d45530d49
2014-04-10 02:24:48 +00:00
dan
d30ab3d9dd Experimental multi-threaded sorting changes to allow the sorter to begin returning items to the VDBE before all data is sorted.
FossilOrigin-Name: f9d5e09afaf64d68a0e461c1c2f38179bcea4b1f
2014-04-09 20:04:17 +00:00
drh
bf20a35d5f Fix harmless compiler warnings.
FossilOrigin-Name: e54dded2012f0ab486ee138e9bd57c528af33980
2014-04-04 22:44:59 +00:00
mistachkin
f7da5555da Fix typo in a Windows threading support routine.
FossilOrigin-Name: 5e3dfa27c71a666e122e3cf64897038ff8424800
2014-04-04 21:40:38 +00:00
drh
48e080b26c Performance improvements when reading large blobs, especially if
SQLITE_DIRECT_OVERFLOW_READ is defined.

FossilOrigin-Name: 2312eb6a9eb31051db4e0baf19e033ba39adc7b1
2014-04-04 18:49:19 +00:00
drh
85462ed939 Merge the latest trunk changes into the threads branch.
FossilOrigin-Name: 39ac79cffe716f88af0871bdd206231b6a6511ff
2014-04-04 18:37:36 +00:00
drh
853546d047 Merge changes to the query planner that strive to ensure that any index
usage that is a proper subset of some other index usage always has a slightly
higher cost.

FossilOrigin-Name: 683dd379a293b2f330e1e4cd746f190527fe48ee
2014-04-04 18:20:35 +00:00
drh
1fb6a11072 Ensure the "PRAGMA journal_mode=WAL" works coming from any other journal_mode
with ATTACH-ed databases.

FossilOrigin-Name: e54330b43127e46fc6494748cbb353a6fc91cfd7
2014-04-04 14:12:52 +00:00
drh
6b5d4759ce Change vdbeSorterExtendFile() so that it makes a best effort to create the
PMA file of the desired size, but does not return an error if unable.

FossilOrigin-Name: 217814bc4b53fab7bdad433e24e8aef8998c38fe
2014-04-04 02:13:26 +00:00
drh
1aca5caa88 Merge all recent changes from trunk.
FossilOrigin-Name: a0910079adde95245680dee59b43613b60903f10
2014-04-03 16:42:21 +00:00
drh
652cc4b6dc Merge all recent changes from trunk,
including the fix for the OP_SCopy-vs-OP_Copy problem.

FossilOrigin-Name: 9515c8344a6743bbb0c6a6e49fb79fb3139090df
2014-04-03 16:35:33 +00:00
drh
c438df1be0 Use OP_Copy instead of OP_SCopy when moving results out of a subquery,
to prevent the subquery results from changing out from under the outer
query.  Fix for ticket [1e64dd782a126f48d78].

FossilOrigin-Name: d5513dfa23baa0b0a095aaf17d19aacd30dcef61
2014-04-03 16:29:31 +00:00
dan
8930c2ab0c Fix an integer overflow problem in the sorter.
FossilOrigin-Name: 9d3351b8d713232133dad149c73fb2a27c72abb1
2014-04-03 16:25:29 +00:00
drh
831116d164 Fix a typo in the "Synopsis:" comment for the OP_VFilter opcode.
FossilOrigin-Name: 48ecdd4aff03741f96c070dced69c3c273b652cb
2014-04-03 14:31:00 +00:00
dan
6e4cc55e1f Fix minor errors causing compilation to fail with SQLITE_MAX_WORKER_THREADS set to a value greater than zero.
FossilOrigin-Name: 0561272abf357a2f4709f6c02866e570d19cd344
2014-04-03 14:29:08 +00:00
drh
a634fb1577 Refactor local object and method names in vdbesort.c so that their names
more closely reflect their actual use.

FossilOrigin-Name: d284e30eb1db144965fa85566e4234e30464350b
2014-04-03 02:54:27 +00:00
drh
54d0d2dd9a In the command-line shell, run set writable_schema before running the
".clone" command.

FossilOrigin-Name: 9d2ae6342c8afa904bec591ebe134ff7f536b71c
2014-04-03 00:32:13 +00:00
drh
ac4f0039c0 Add a big introductory comment to vdbesort.c explaining its operation at a
high level.  Also adjust some symbolic names and fix other comment issues in
that file.

FossilOrigin-Name: eef60f1bf54fcdc7b32f96ebb87a9a0bf0776e8b
2014-04-02 18:58:49 +00:00
dan
dd95d30f82 Fix some problems with OOM handling in vdbesort.c.
FossilOrigin-Name: 47e702bd8392bc50c4edaf6a2c8c499af87b520e
2014-04-02 15:15:25 +00:00
drh
8d8f56296b Change the name of the SorterThread object to "SortSubtask" to avoid confusion
with the SQLiteThread object.

FossilOrigin-Name: 4ee2d910fbbed8d4def15e4e99ee225839f3a739
2014-04-02 14:38:14 +00:00
dan
fad9f9a8a6 When sorting data for a CREATE INDEX statement in single-threaded mode, assume that keys are delivered to the sorter in primary key order. Also fix various comments that had fallen out of date.
FossilOrigin-Name: 821d1ac4504243fa13b9e3c0d56361ad9fb80d78
2014-04-01 18:41:51 +00:00
dan
578e1ca8d7 Even if compile time option SQLITE_MAX_WORKER_THREADS is set to one or greater, set the default number of worker threads to zero. Distribute data more evenly between threads in sqlite3VdbeSorterWrite() to improve performance when sorting large amounts of data. Add new test file sort2.test.
FossilOrigin-Name: 643c86a056168e39fcb7f39b8a72731f1eb246db
2014-04-01 15:38:44 +00:00
dan
38fdead890 Fix a problem with OOM handling in the sorter code.
FossilOrigin-Name: 59cd5229e2b5be5272cf57c7e7d09e97d16a5425
2014-04-01 10:19:02 +00:00
drh
a38c9516e8 Remove an unnecessary conditional, replacing it with an assert().
Improvements to comments.

FossilOrigin-Name: 834bf1c367e1ccd498c7f9f843be2d2aa11ffb3c
2014-04-01 01:24:34 +00:00
drh
4c417181c2 Fix a compiler warning when SQLITE_DIRECT_OVERFLOW_READ is defined.
Minor performance enhancement and size reduction.

FossilOrigin-Name: 96385dc460545807a5c8fcf6280a971700f84866
2014-03-31 23:57:41 +00:00
drh
e4529c5724 Merge in the latest changes and fixes from trunk.
FossilOrigin-Name: f6211540c9d66a08dc580dd733e4f4a98968ae30
2014-03-31 22:03:32 +00:00
drh
d3c156638a Remove an unnecessary conditional.
FossilOrigin-Name: 7473c4dfc10a47594affa6f4e071a08dc8838c0c
2014-03-31 20:05:20 +00:00
dan
b3f56fdb69 Add the SQLITE_MAX_WORKER_THREADS compile time option. And the SQLITE_CONFIG_WORKER_THREADS sqlite3_config() switch.
FossilOrigin-Name: 2774710df8cd2bfaca49888c69f1b01c0ddadf9a
2014-03-31 19:57:34 +00:00
drh
3fb183d2f7 Also make sure an index that is a proper subset of some other index has a
higher cost than that other index.  Add test cases.

FossilOrigin-Name: b7830d232b073a197aa1092e78cb24e88cb10fd3
2014-03-31 19:49:00 +00:00
drh
53cd10afcd Make sure that an index that covers a proper superset of the WHERE clause
terms of some other index has a lower cost than the other index.

FossilOrigin-Name: ea8b0910040198751551b0b960e6b783913607df
2014-03-31 18:24:18 +00:00
drh
b663587890 Avoid a (harmless) buffer overread that is possible on an OOM when
MEMSYS5 is engaged.

FossilOrigin-Name: b3296267fb67b9f59719a37093253062edde3746
2014-03-31 13:42:42 +00:00
drh
7a4b1642a7 Experiments in picking better query plans, especially when the usage of one
index is a subset of another.

FossilOrigin-Name: 8f869ca7a6eaa9ca7a08102290e6c606735f9090
2014-03-29 21:16:07 +00:00