Commit Graph

321 Commits

Author SHA1 Message Date
drh 064b681e9b First attempt at getting the build to work with Tcl 9.0.
FossilOrigin-Name: 6e5bb48a74d63fb8c30528f0005d1763cd2dbb882abf86baf1565721e6bfcf84
2024-07-30 15:49:02 +00:00
drh f10de5360a Must use sqlite3IntFloatCompare() for accurate comparisons between very large
integer and floating point values in RTREE.  Otherwise the comparison does
not work on all platforms.  Further fix to [027e5336acc26f57].

FossilOrigin-Name: 820f106acff5f2cd01da0e95a0e6f2bcc087705bf8c08b730b1fdb08db5679c8
2024-03-08 03:24:09 +00:00
drh a64342ee9c Correction to the previous check-in.
FossilOrigin-Name: 483fa2969e1e10cd8e8d2f9e3027871c65b1360b6c23897efe3ce63a3a55ae13
2024-03-06 12:28:55 +00:00
dan 53ca213e73 Fix handling of "id=?" corner cases in rtree when the value on the RHS is a real value.
FossilOrigin-Name: 027e5336acc26f57f21df4980928731026c30cf88688fa0b66f13ffa0b5da3a0
2024-03-06 11:35:36 +00:00
drh 8e821c251d Replace the assert() that was removed by [f023cb541b5dd72c] because
[1cd5d4623f44af25] made it true again.

FossilOrigin-Name: 189a49f165dfc348a8730ad2b2288b9b2b2089b1de99fa2d515f2a90c9e7bd4e
2024-02-12 19:12:30 +00:00
dan 98a8ffb3b3 Have rtree avoid keeping a blob handle open following an error.
FossilOrigin-Name: 1cd5d4623f44af25ab4f5af580354b3ae22cf5de4109e008ca41055125bb708d
2024-02-12 16:12:25 +00:00
drh 18b6019cdd In the RTREE extension, allow the xBeginTransaction() entry point to be
invoked multiple times without intervening calls to xEndTransaction().

FossilOrigin-Name: f023cb541b5dd72c996f0574210344179217666a2229bc8d3fe057fdbc5c2245
2024-02-11 22:56:12 +00:00
drh 722bd1fe89 Bring test cases into alignment with the latest enhancements.
FossilOrigin-Name: cd017c28d516399e25b5ee9e8fcd7390ca2be9128c7c41f1007f37bc01a35717
2024-02-07 19:52:03 +00:00
dan 5e922865aa Return SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree query in such a way as to invalidate an rtree internal priority queue entry. This replaces the SQLITE_ABORT_ROLLBACK mechanism added in [af5c4251].
FossilOrigin-Name: 32f85a5ce8e32506ad0cf309c86589958f38d924b4b3de532bec8bdb8e385fad
2024-02-05 17:54:03 +00:00
dan 8e4d004ba1 Return SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree query in such a way as to invalidate an rtree internal priority queue entry.
FossilOrigin-Name: 478280ef67efed854988ab4f740a38ae1937204c0434ad8da11f1869a12a6d06
2024-02-05 17:35:36 +00:00
drh 7d6f33046f Following a ROLLBACK that reverts changes to an RTREE, any pending queries
against that same RTREE abort with code SQLITE_ABORT_ROLLBACK.
dbsqlfuzz de7d17b72d0e842352c998dd86a47b7d0f707be9.

FossilOrigin-Name: af5c425114f32c2f84aea20edd4fa46eb1bfdeb3747fce357540e15978a070c8
2024-02-03 19:19:18 +00:00
drh bf64cbd463 Remove an ALWAYS() from RTREE. Dbsqlfuzz found a way to make it false.
FossilOrigin-Name: 40f0a29e6dd90fcb969d7c0e49728ba0ee8f31d9e8f502b9a21469620a8ad283
2024-01-07 20:27:54 +00:00
drh cd6ea30b82 Updates to RTREE to facility testing.
FossilOrigin-Name: 7a5b42ff74882c58493dc8b710fde73d4ff251f5d42271d84be73ceaabc01698
2024-01-07 00:45:53 +00:00
drh 6572f7799c Disable two rtree test cases for Linux-i686. We do not have that platform
available for testing.  The test cases work on all other 64-bit and 32-bit
platforms that we have at hand.  So there is no way for us to debug this
problem.  Better to disable the test.
[forum:/forumpost/ffcbf789b5386573|forum post ffcbf789b5386573].

FossilOrigin-Name: fed4d6e90baecca716429f95e1fab7930297afa2a191a87a0a87cb93910d1bce
2023-10-27 18:16:15 +00:00
drh 9f20bde65a Enhance the new xIntegrity method of the sqlite3_module object with new
parameters that provide the name of the table being checked and
a flag to indicate a "quick_check".  Based on feedback in
[forum:/forumpost/965c0d02ea|forum post 965c0d02ea].

FossilOrigin-Name: bc8afa3f15954bb35f65dbf940bf069de5e14d333036676c24430cf17b658d05
2023-10-25 10:37:11 +00:00
drh 153790d9ae The rtreecheck() SQL function should not invoke BEGIN or COMMIT as this
causes issues for statement transactions.

FossilOrigin-Name: b7b2e30b570efda338c62e88446dedb6667640f33855b2422ad20c7b569b025a
2023-10-14 17:14:53 +00:00
drh 4b136ed70a Enable SQLITE_VTAB_INNOCUOUS for FTS3, FTS5, and RTREE.
FossilOrigin-Name: f34c533b6c1f8ef3f69c75c1039406c12751cdde1fbdcb4d9776b24455facf8a
2023-10-12 18:46:27 +00:00
drh 1935887a68 Ensure that all fields of static sqlite3_module objects are explicitly
initialized, in order to hush-up nuisance compiler warnings.

FossilOrigin-Name: f3b3d712d6e58b1cb8fdebd2b6b3125080b6b3ac8c7c849a8cc1e5e778d62fe7
2023-10-06 12:51:05 +00:00
drh 647e3ed2ba Reduce the number of calls to sqlite3_mprintf() made by RTree.
FossilOrigin-Name: f158b7d4917e0951fbb86a6f438abcb618d8602566fa54bf04c05a37f3a73513
2023-09-14 01:46:57 +00:00
drh 7de8ae22f7 Omit the Reinsert algorithm from RTree. This causes most benchmarks to run
faster, at the expense of having a slightly less dense and hence larger index
(example: 33 entries/node versus 34 entries/node).

FossilOrigin-Name: b3049a1d3dbdd63c471499c2f6b417655defe9ad90228e7cc722f5be877aae01
2023-09-13 17:30:12 +00:00
drh f9967cb302 Performance optimization to cellContains() in RTREE.
FossilOrigin-Name: 43cde22bf3f36687df231eddf642581d1d4f4102ad8568d31f5b2ff0302ca800
2023-09-13 14:07:07 +00:00
drh cdae00b3e8 In the ChooseLeaf algorithm of RTREE, do an initial pass through the cells
of a node looking for solutions that involve no cell enlargement.  Only look
for the minimum cell enlargement if the enlargement is non-zero for all cells.
This results in a performance improvement by reducing the number of calls
to cellUnion().

FossilOrigin-Name: 59f0e239d19393190911ea3bd89b5a24be0d85d64ccf51906efc9537ad5d7298
2023-09-13 13:12:08 +00:00
drh 386e359044 Reduce the number of calls to cellArea() in the ChooseLeaf() algorithm of
rtree.

FossilOrigin-Name: c633fe6be0edc07a0aa1ac819d58b6c629b7c95b47b63516ae1b0a937f6a2b89
2023-09-13 12:06:02 +00:00
drh f4ae37ca44 Remove unused variable from the ChooseLeaf algorithm in r-tree.
FossilOrigin-Name: fb2e4a8067edc29ba64973820f265b21dfee0d32f4d675d32100d5eef93c2830
2023-09-13 11:36:44 +00:00
drh d5ab4dd9e4 Change the xIntegrity virtual table method signature so that it returns
an integer error code and writes the error message into a parameter.

FossilOrigin-Name: f1d4024a8ca06cf954aaf1f612684d1a5d28492bde757695db3f22c50c649709
2023-09-06 14:00:01 +00:00
drh 961c2a9f36 Add the xIntegrity method to the sqlite3_module object. Implement this
method in RTREE, FTS3/4, and FTS5 so that "PRAGMA integrity_check" also
verifies the correctness of shadow tables associated with those virtual
tables.

FossilOrigin-Name: 17bede8cdefd968210dd8a5a2617acbe12ba2c99fdd5e88c5def8665e7bec2d7
2023-09-06 12:52:00 +00:00
drh 25a6e6ec8b Do not make assumptions about the byteorder of PowerPC processors.
FossilOrigin-Name: 4a2498fed4c5436fbcd4179db85e2741fdab37d42b0eebf12f41ec4573ce2c61
2023-09-04 12:50:17 +00:00
drh 114ad2f86f Address minor inaccuracies in fuzzcheck and RTREE found by UBSAN.
FossilOrigin-Name: a64e6c2fd8ef1d2d7f14aa9265629853298bbc480c2683c79dfd24847a61b68b
2023-08-21 14:28:47 +00:00
drh 8e5cef7bca Fix harmless compiler warnings that show up on 32-bit RaspberryPI builds.
FossilOrigin-Name: bc4d20f362925e4ce5c79f0d7a27a8e9bbac92525bd4cea2ae983798e3f8c37d
2023-06-17 15:42:44 +00:00
drh 0503cd6d11 When a floating-point RTREE is presented with large integer constraints -
integers that are too big to be represented exactly by a float - then take
extra steps to ensure that all possibly relevant entries in the RTREE are
returned, even in boundary cases.  Fix for the problem identified by
[forum:/forumpost/da70ee0d0d|forum post da70ee0d0d].

FossilOrigin-Name: bfd8d9100015f3e3fb011698963d670bd89b64ec8a8ab931e0c6c3076b029377
2023-05-22 16:35:21 +00:00
drh 1cb4e2e196 Change the RTREE engine so that equality comparisons of floating point
values are duplicated in the byte-code so that the comparisons are done
using 64-bit floats and consistent results are always obtained.
[forum:/forumpost/da61c4a1b5b4af19|Forum post da61c4a1b5b4af19].

FossilOrigin-Name: 4ec0f0a31b0df93ad15545fe1db117c933e28c75ad3cbc8475b56fecdb084905
2023-05-19 11:48:05 +00:00
drh 7eff609d8a Update the compile-time detection of architecture byte-order in the RTREE
extension so that it is aligned with the latest enhancements in the core.

FossilOrigin-Name: 122431d3a7267ec83768316ab146c0557fb6c0577a4a47ac6ed3d7aa6811ca9a
2023-04-24 19:23:42 +00:00
dan 3410e550dc Make the SQLITE_DBCONFIG_STMT_SCANSTATUS option on by default.
FossilOrigin-Name: 5a09191186bc03b374e0c0d029e1a15208c6b845bc2f5f5f9f6a8a882809d9f3
2023-03-03 21:17:12 +00:00
dan 986c22a6d0 Update testrunner.tcl to use a separate process for each test script. And to run some extra tests too.
FossilOrigin-Name: d090948a69a9c4b86693bd3caedba3d7e5883e4b2ad1f2d4bf7ae14c105ddea7
2023-02-01 20:14:59 +00:00
dan d993b15aa3 Ensure that the database encoding cannot be changed while there are statements running. And that the connection is left in a valid state after an obscure OOM within sqlite3_deserialize().
FossilOrigin-Name: a02da71f3a80dd8e817e89cdaa775c95e38c90d2471f8fec516bed086539e2c0
2023-01-20 17:50:24 +00:00
drh 3547e4997f Fix lots of harmless, nuisance compiler warnings, mostly unused parameter
warnings in extensions.

FossilOrigin-Name: c14bbe1606c1450b709970f922b94a641dfc8f9bd09126501d7dc4db99ea4772
2022-12-23 14:49:24 +00:00
drh de033d078b Ensure that the RtreeCell object in rtreeUpdate has all bytes initialized.
FossilOrigin-Name: 1e38742bde09cd879eb370bcf8604ed7ed00759209bcb4ed0374350e4b9e842d
2022-10-21 17:18:58 +00:00
drh f98109e7cb In the xUpdate method of the GeoPoly virtual table, make sure that the
number of updated columns does not exceed the underlying implementation, even
if the virtual table object records an excess number of column in the nAux
field due to table constraints in the table definition.
Fix for the problem reported by
[forum:/forumpost/a096ab7d96bb057a|forum post a096ab7d96bb057a].

FossilOrigin-Name: a04dd475c2c8afdded0afecfd34c6c4c2f48cce520e09b7fa5172ff30f09209e
2022-08-01 13:14:03 +00:00
dan f703b42dc4 Update the expected error messages in some OOM test cases to account for [44d77a7f807].
FossilOrigin-Name: b3d6b3c3fc68dca7e20418eefa35ce3b583322b884b88a11c6773419f027a7a4
2022-07-11 21:40:34 +00:00
drh d7480403bc Do not allow an ON clause to references tables to its right if there is a
RIGHT or LEFT join anywhere in the query.  Other RDBMSes prohibit this always,
but SQLite must allow ON clauses to reference tables to their right for legacy
compatibility, unless there is a RIGHT or LEFT join someplace in the query,
in which case there is no legacy to support.

FossilOrigin-Name: e615dbe02ca949252d1526ed5c48f8ce08159773ea2008ce666484379d0d9854
2022-06-20 17:04:44 +00:00
drh ae8776e092 The fix at [cab9b4cccd13bf0a] was incomplete, as demonstrated by
[forum:/forumpost/57bdf2217d|forum post 57bdf2217d].  This check-in
should complete the fix.

FossilOrigin-Name: fb0a23b6789da8e934562ce9ebd9d58ea13a10fd10dee5cbfc7ac8f394e1aeec
2022-06-20 12:42:28 +00:00
drh c583719b65 Show LEFT and RIGHT JOIN processing in the EXPLAIN QUERY PLAN output.
FossilOrigin-Name: d91faeffea5cf0585fb71e5311fdcc6b8be85c7e9c732050b4448e617c970101
2022-04-11 14:26:37 +00:00
drh 60f3657b4a Fix an undersized memory allocation in the test harness for RTREE. This
error was in test logic only, not in the SQLite library itself.
[forum:/forumpost/35470a0a72a005e1|forum post 35470a0a72a005e1]

FossilOrigin-Name: 7e3c9594390ac8defaf9825e14b4c19ef8c123b747971dd3d4df16110f443d3b
2022-02-22 15:47:55 +00:00
drh 7d44b22d45 Fix test cases so that they all still work even with -DSQLITE_DQS=0.
FossilOrigin-Name: 4883776669ee2f2310ea82b0d6df4d008eebaa7cb252102539cf21a635402ebb
2022-01-16 19:11:13 +00:00
drh 9dbf96bd70 An attempt to integrate the JSON functions directly into the SQLite core,
rather than holding them as an extension.

FossilOrigin-Name: 583b47d865fb8d2c9ae4d3a4e70356a8a758978efb0a282f6b19775bf41fb748
2022-01-06 01:40:09 +00:00
mistachkin 2b5fbb2836 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: a9bfb621091b6d92d1caeb69134d3809d9e0b43fe764608c5995db277ac785be
2021-12-31 18:26:50 +00:00
dan 826ec6013c Fix a performance regression in rtree introduced by the previous commit.
FossilOrigin-Name: 7f42b8e1a25c0830fe81e4668318998af595826784a50780a5c1c0b4d95a2482
2021-11-18 20:11:31 +00:00
dan 895c807a6d Fix a problem slowing down the handling of == constraints in the rtree module.
FossilOrigin-Name: 509027e964f28efca088a41fe32f01c38316f7a919de63a8835e3bc7c3fb0787
2021-11-18 19:15:40 +00:00
drh dcf10a1a4b Fix harmless compiler warnings. Improve the independence of some TCL tests.
FossilOrigin-Name: 1a038242dc6c0cab97dd9375acfce62aa1c386debc36aaed388d366b87ddd931
2021-10-22 11:17:29 +00:00
drh 9fdd66e3c0 Enabled the testcase() macros under SQLITE_DEBUG.
FossilOrigin-Name: 0ae8dd132db8331ca9cc42ad511066924f9d3a1d158ecdb630cebc41b6bd2493
2021-10-20 17:58:33 +00:00