Commit Graph

115 Commits

Author SHA1 Message Date
dan 2f94935409 Allow the shell to be built from the configure script with
SQLITE_OMIT_VIRTUALTABLE defined.

FossilOrigin-Name: 136bf323e42dc90e1780199a381bcbb084b069eca5c7343ee6fc6e2550831536
2018-01-20 15:48:45 +00:00
drh 468c649331 Add unnecessary initializations to some local variables in the rtree module
to suppress false-positive compiler warnings coming out of MSVC.

FossilOrigin-Name: 64487d658cb3b6c8c67f1e198c70813c963de52599f3ea974bdc2aa432e74de9
2017-12-16 04:37:15 +00:00
dan 7e2b38c53b Add tests cases and fix minor issues in the rtreecheck() function.
FossilOrigin-Name: d6130cd226c0ca95e02f0cbabfdc27071acdcf83e0d0cb0eaa47d992479ed9a1
2017-10-25 18:17:24 +00:00
mistachkin 8c66e5b73e Fix compilation issue (C99-ism) seen with MSVC.
FossilOrigin-Name: 61870b42b033189509b244c76d28932f7a447b887ffe04a3c81461148e54cfb5
2017-10-25 18:00:58 +00:00
dan 1917e92fdb Add SQL scalar function rtreecheck() to the rtree module. For running checks
to ensure the shadow tables used by an rtree virtual table are internally
consistent.

FossilOrigin-Name: dde0bb3eab1316c3247b1755594527ca70955aab4ad4907190731f7ec092b327
2017-10-25 16:38:34 +00:00
drh 9616805728 Fix a potential use of an uninitialized pointer in RTree following an OOM
error.

FossilOrigin-Name: fd4ec0cdbd84f3333dd4c7a4236491bce6b9ab21fb2c088751ca1279b31bd864
2017-09-21 13:11:47 +00:00
drh 6362bbe68d The RTREE extension should return SQLITE_CORRUPT_VTAB, not just SQLITE_CORRUPT
when it encounters incorrectly formatted shadow tables.

FossilOrigin-Name: 0712f057ef3dcd907984dda30f6d961a29b61c1d2b25627028c4e227ec85dbba
2017-08-17 18:17:24 +00:00
drh 22930062d5 Add a destructor argument to sqlite3_bind_pointer()
and sqlite3_result_pointer().

FossilOrigin-Name: 3d9e841f6011480ebb8a6d860da72af7fa545983e08835ddef2cac96e5f5cd4b
2017-07-27 03:48:02 +00:00
drh c7b1ee5f6e Enhance the RTree module to detect node truncation early and report an error.
FossilOrigin-Name: 66de6f4a9504ec2670b7273de8fb6955c80e03f7f73414ea6b80fd8a99f75976
2017-07-01 15:21:17 +00:00
drh 2c2f392dca Add interfaces sqlite3_prepare_v3() and sqlite3_prepare16_v3() with the
extra prepFlags argument.  Add the SQLITE_PREPARE_PERSISTENT option as one
bit in that argument.

FossilOrigin-Name: 4a25c5883380fe5990d8180adb58c3bdc7a3d081bc4c69cd4de3cd57074fb251
2017-06-01 00:54:35 +00:00
drh f8a2e8c2d2 Fix requirements marks and harmless compiler warnings.
FossilOrigin-Name: 198ff4c01d86d193a54745764d69376cab8e94747a4daa444690f7e1ec87800b
2017-05-06 17:12:52 +00:00
dan 5b09d13a58 Have the rtree module close any open blob-handle within the xSavepoint method.
This prevents such an open blob handle from interfering with DROP TABLE
operations.

FossilOrigin-Name: fa4416adc2a9a3a80db1d5befc0b95c3d0fc41affe38f7f2f45cdfae3f1b49eb
2017-04-08 13:52:41 +00:00
drh 297e2bdb8e Make sure the RTree sqlite3_blob handle is reset prior to renaming the table.
FossilOrigin-Name: 1cdae2db3c54970a1811e597065724578408c84d49d75b8fe25d56281ddc2e94
2017-04-08 01:09:14 +00:00
dan 6b904f5e01 Avoid a technically undefined right-shift of a signed value in rtree.c.
FossilOrigin-Name: a144875fe44ff3a30bab299d50b7dbec2ee21f8c73e692a71ee1f7c54b5f0c76
2017-03-20 19:26:27 +00:00
drh dc5ece86ae Remove the CLANG_VERSION macro, since we have learned that version numbers in
clang are "marketing" and are inconsistent and unreliable.  Builds using clang
will still use the GCC_VERSION macro since clang works hard to be gcc
compatible.

FossilOrigin-Name: 810d29320b853b3a01aa50d8f2a0bceacf79e0aa
2017-02-15 15:09:09 +00:00
drh a39284bfa8 Cleanup the usage of the SQLITE_DISABLE_INTRINSIC compile-time option.
Remove the SQLITE_RUNTIME_BYTEORDER compile-time option.  Use
-DSQLITE_BYTEORDER=0 instead.  Fix a bug in R-Tree that occurs when compiling
on a known little-endian machine without the use of intrinsic byteswapping
functions.

FossilOrigin-Name: 798fb9d70d2e5f95e64237b04d6692360133381a
2017-02-09 17:12:22 +00:00
dan 9fcb6ddc1e Fix a build problem affecting non-amalgamation rtree builds.
FossilOrigin-Name: bb7f445ba1df53cd4a169612b18fc533016102b7
2017-02-07 14:45:18 +00:00
drh 364ca6a90e Fix SQLITE_BYTEORDER #defines in R-Tree when compiled separately from the
amalgamation.

FossilOrigin-Name: a136609c98ed3cc673c5a3c2578d49db3f2518d1
2017-02-07 13:51:48 +00:00
drh edd9bcb372 Make the cellMargin() routine of R-Tree slightly smaller and faster while also
fixing a harmless compiler warning.

FossilOrigin-Name: 07fe6228208684d579c4f6c334c90eb6262a9233
2017-02-07 12:58:38 +00:00
drh b18bf843f7 Fix a minor typo in a comment in R-Tree. No changes to code.
FossilOrigin-Name: f77ee9e941f22b0b2e88871df4466fdde9cde131
2017-02-07 00:55:47 +00:00
drh 04128ace8d Remove a small amount of unnecessary code from R-Tree.
FossilOrigin-Name: e5aea894267addb4dc9b21de24a20417b0be508a
2017-02-06 16:52:32 +00:00
drh 9630f3ba08 Remove incorrect testcase() macros from R-Tree.
FossilOrigin-Name: 853a58a75ecbd01ebbf7e07fbd8c4fc9bef54a99
2017-02-06 01:19:07 +00:00
drh fe05491b87 In RTREE, use an sqlite3_blob object rather than an sqlite3_stmt object
for reading content out of the %_node shadow table.

FossilOrigin-Name: 97ccf3e4de11ffea46993cb7fb7ab559b9810705
2017-02-04 14:24:05 +00:00
drh 010e312f8f Close sqlite3_blob objects on xSync rather than waiting until xCommit.
FossilOrigin-Name: 95ee745fceb4a48c683f34c404c380fe5e7d684a
2017-02-04 13:12:12 +00:00
drh 3accc7e1af Remove the unused pReadNode prepared statement from each RTREE object.
FossilOrigin-Name: e51dc0ec60d45cd57564735b6b2bb254a588533e
2017-02-02 16:30:25 +00:00
drh ce655a2367 Fix a potential uninitialized (though harmless) variable in RTREE.
FossilOrigin-Name: a1c74e09d63aca630d022ed074866433eed6b493
2017-02-02 16:08:27 +00:00
drh 413e207e31 The sqlite3_blob_close() interface can cause recursive invocations of
nodeBlobReset() in RTREE.  Make sure that does not cause problems.

FossilOrigin-Name: 88333441cbf26bfde2acebf2a3f75b5ebbdfb0ae
2017-02-02 15:35:54 +00:00
drh 2033d1c8ca Change RTREE so that the sqlite3_blob object is closed whenever the cursor
count drops to zero and there is not a pending write transaction.

FossilOrigin-Name: 9bb4eafe1a60176ed2e731bb7e3067c0b8a46615
2017-02-02 14:40:06 +00:00
drh 6d683c5c6e Use the sqlite3_blob interface for reading values from the %_node shadow
table in RTREE.  This is a work in progress.  There are still some minor
problems.

FossilOrigin-Name: fc4917d730b29b0bf60fea5e0166728635783e9c
2017-02-02 02:28:45 +00:00
mistachkin 6890d3e458 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 0c66cf0f0a9ada2ddcb8d61001ef791b86226416
2017-02-01 23:06:17 +00:00
mistachkin 2fa517bf2a Fix C99-style variable declaration issue seen with older versions of MSVC.
FossilOrigin-Name: 54d285464a222c59327eb6c917c1cc0125a55a27
2017-02-01 22:59:29 +00:00
mistachkin 2e52532217 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 997f765bc6706769ae15f3e719354473e02bd78b
2017-02-01 22:43:08 +00:00
drh 31a1349515 Unwind the RTREE dimension loop inside of rtreeCallbackConstraint().
FossilOrigin-Name: 4854ea9c18e7d8066c90b41568d0fae97b01ea6d
2017-02-01 17:08:56 +00:00
drh 5db59b33c4 Completely unroll the dimension loop inside of cellArea() in RTREE.
FossilOrigin-Name: 3c4c0126c287f844220b65e00fec17c059fbb7c8
2017-02-01 16:41:30 +00:00
drh 0e6f67b754 Precompute the nDim2 value in the Rtree object and use that to make loops
over coordinates faster.

FossilOrigin-Name: f1f3c8cc733a05c12dd980f2dfa0ab4ccd76c04b
2017-02-01 15:49:02 +00:00
drh 03626e3812 Use compiler intrinsic functions (when available) for byteswapping in RTREE.
FossilOrigin-Name: 82fcd54a5941c20895ffc22d8009c1ebdae44eda
2017-02-01 15:24:32 +00:00
drh 14494fa712 More RTREE performance optimizations related to decoding values.
FossilOrigin-Name: c5395e7496d0cd593f5e16ee5f6719d020dc0c66
2017-02-01 02:25:28 +00:00
drh fcbd6cdb41 R-TREE optimization: unwrap the coordinate decode loop in
rtreeCallbackConstraint().

FossilOrigin-Name: 0bf7b51896ec441f62490964c7a44a3c75c6b7e2
2017-01-31 21:22:03 +00:00
dan ea5e5f0b89 Fix a case in which the rtree module was ignoring an OOM while generating an error message.
FossilOrigin-Name: 788f86bebe413b5a0ab41ba3d75ba8728827a964
2016-10-10 10:06:59 +00:00
drh 2e5c5052fd Fix typos in comments. No changes to running code.
FossilOrigin-Name: a07269f2a0f87e0b736127f528f6caf3b63f9052
2016-08-27 20:21:51 +00:00
drh e62c2fe179 Fix RTREE so that it does not run queries against the sqlite_stat1 if that
table does not exist.

FossilOrigin-Name: 48526a2fe5373e3d19e8b813cc8a342d6b7c9c3d
2016-05-23 18:12:04 +00:00
dan 5782bc27fa Improve the error messages generated by the rtree module when a constraint fails.
FossilOrigin-Name: 3ad2531efb64b7c53b777ddf3681203217052b32
2016-05-23 16:16:13 +00:00
drh 2ea74dc805 Adjust the cost estimates for RTREE such that the expected number of rows and
expected cost is halved for each additional constraint.

FossilOrigin-Name: fd7cd0609381a85673d1f737ebeb19dde3de180f
2016-03-05 20:28:24 +00:00
drh 18070e08c5 Fix incorrect validation of the size of the BLOB returned by a geometry
function on the RHS of a MATCH operator in RTree.  The old code worked for
64-bit systems (by chance) but fails on 32-bit.

FossilOrigin-Name: 10cc44f5a63e6cadf6940bb7310a177ee7fa6ee2
2015-05-22 23:17:28 +00:00
drh fd29973f11 Update with fixes and enhancements from trunk.
FossilOrigin-Name: 9605d008f5c763137e9734d033fe4510ca316858
2015-05-22 18:40:48 +00:00
dan 6b76418e67 Have r-tree prefer to use the constraint "col MATCH ?" over "rowid = ?".
FossilOrigin-Name: b9fb95194d4f7c535f1d175fd2e18d69d76e8fc4
2015-05-22 16:08:42 +00:00
drh 4f03f413bc Add the sqlite3_value_dup() and sqlite3_value_free() interfaces. Use
these interfaces to enhance R-Tree to add the
sqlite3_rtree_query_info.apSqlParam field.

FossilOrigin-Name: a7ee40c4fc62843ac5b96ba47ca14a66e8cd6961
2015-05-20 21:28:32 +00:00
drh 856d446efe Allow R-Tree geometry functions to take 8-byte BLOB arguments which are
passed directly through to the underlying callback, and which can be used
to pass pointers into the callback.

FossilOrigin-Name: b271ed56532a78323accc8a7cb348d55f95c350e
2015-05-19 22:20:48 +00:00
drh e9c5f97683 Fix an assert in RTREE that would fire if the rtree table is misdeclared.
FossilOrigin-Name: 9a45409cc4078f2b6e68aa777f6ab86a14309833
2015-05-01 18:00:37 +00:00
drh 068a251d99 Simplify some code in rtree, to avoid confusing the optimizer in GCC on
some macs:
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00).
Prior to these changes, compiling with -O3 would cause incorrect code to
be generated.  The change to the nodeGetCell() routine is key.  The other
changes are merely cosmetic details discovered while bug hunting.

FossilOrigin-Name: 882181ff9dd75f32db266db6e476671021fc567b
2015-01-13 21:26:17 +00:00