Commit Graph

7966 Commits

Author SHA1 Message Date
dan
b695bab055 Fix another fts3 problem with processing corrupt records.
FossilOrigin-Name: 6e0ffa205312416830340ea6e621dfb1a529e5603d569941ed6263930dc28c45
2020-06-29 13:33:56 +00:00
dan
30b5db1261 Fix a problem that could cause an infinite loop in the fts3 'merge' command.
FossilOrigin-Name: be545f85a6ef09cc6c762f7d2ab7a0b3adf5590c3fbdc9903e6b5b5cec6e823f
2020-06-26 20:41:18 +00:00
drh
22f874168a When computing the verification hash in speedtest1, do not include the
value of floating point results (which can very in trailing bits depending
on platform) but merely hash the fact that a floating point value was
received.

FossilOrigin-Name: e12225d59c63ba392db4fa8dc26700ac26b20c8b98ea5107eef0e0b5138ace87
2020-06-26 17:56:43 +00:00
drh
0581214577 Improvements to speedtest1.c for more consistent verification hashes.
FossilOrigin-Name: d34b8ff5f8d04a75996f6ca9d3a0563c83e8e833c1eb08ac3861431f36f7bfb1
2020-06-26 16:17:27 +00:00
drh
6df54c30fc Improvements to speedtest1. Added the --memdb and --output options. The
--verify option now outputs a hash of SQL outputs.  The speed-check.sh script
disables the hashing feature with --legacy and adds the --verify option.

FossilOrigin-Name: f3455cecf22ea98f9ad48e92d620c8e2ec94877e4581731afff0f2bd32014a1d
2020-06-26 15:42:55 +00:00
drh
85c4754697 Add the ieee754_to_blob() and ieee754_from_blob() functions. Fix the handling
of subnormal forms in the two-argument version of ieee754().

FossilOrigin-Name: c78cbf2e86850cc6882d3f0bd5415f6e731c3c675ffe77bb343682c619cb8cd9
2020-06-26 15:32:29 +00:00
drh
3c99dbb18b Add --verify to speed-check.sh and add --memdb and --output to speedtest1.c.
Other improvements to speedtest1.c.

FossilOrigin-Name: 89a11120ab2ce13f8a539cb05a9d0628a1f83b4790910b2023c21d60aabc43ee
2020-06-26 14:05:58 +00:00
drh
d8d335d737 Fix a possible null pointer deref following OOM. Discovered by dbsqlfuzz.
FossilOrigin-Name: cc888878ea8d5bc754c69de523819d32d6d9853857e31d7287f9dbfd723428db
2020-06-26 04:34:28 +00:00
drh
99f363b35e Enhance the --verify option to speedtest1.c so that it computes and displays
a hash of the result from all SQL queries, for verification purposes.

FossilOrigin-Name: 60d1e46c8c8a3c853034fd79f204bcb5d50d1c366eb246849c333a2d0abc2648
2020-06-25 20:28:13 +00:00
drh
9f683de872 Add the decimal extension. It is built into the shell, but is an optional
add-on for the library.  It is not included in the amalgamation.

FossilOrigin-Name: 5391687bf8563b3fdd157b436b2cbb6a0ee5f676727d41bbddfaa8eacc39729b
2020-06-24 12:29:19 +00:00
drh
9e44f265a7 Enhance the --testset option on speedtest1 so that it can accept a
comma-separated list of test modules to run in order.

FossilOrigin-Name: 780e8aaa231b2b585505c3886d5a13d39dba546fdd8020331ad4de2ae92922b0
2020-06-23 20:03:57 +00:00
drh
6b64718618 Avoid unnecessary normalization in decimal_sum(). Trim excess trailing
zeros off the result of decimal_mul().

FossilOrigin-Name: 0294ce071c863eb517e97beff31c3d95a4370e979a969415162302a90d3fda0e
2020-06-23 14:44:57 +00:00
drh
427af8dc3d Add the decimal_mul() function.
FossilOrigin-Name: 72eee04b67268ad38fd51ff32849f08c0a54cf1b481d5ecb11d77cc9c729ee03
2020-06-22 21:25:37 +00:00
drh
beb9def059 An extension for doing decimal arithmetic on strings.
FossilOrigin-Name: 4c3b85607feb53462ccc8b89bea699fdb132c402eae597afa33cc40a85c32329
2020-06-22 19:12:23 +00:00
drh
067b92ba00 Extend the refactoring into extensions. Clean up stray newlines.
FossilOrigin-Name: 7a876209a678a34c198b54ceef9e3c041f128a14dc73357f6a57cadadaa6cf7b
2020-06-19 15:24:12 +00:00
drh
1e32bed3c1 Further refactoring of the schema table name.
FossilOrigin-Name: 9536fa0ae0c1ae6e2e98d2fa11e5acda7f3c9b8ca5061b6f7f8cae63a11d936b
2020-06-19 13:33:53 +00:00
dan
877859f2d3 Fix an assert() that could fail when operating on a database with a corrupt schema.
FossilOrigin-Name: 4a340c9bc7d939efc947e3b17ca79314482f74368b15567dd089d40e4270890e
2020-06-17 20:29:56 +00:00
dan
0ad1b3284a Fix an assert() in fts3 that could fail when processing a corrupt record.
FossilOrigin-Name: 4adc0a1b0d84c2df6d6bf0d5d9d3fa9f7d048af8d232c4beb77518727890f212
2020-06-17 14:54:06 +00:00
drh
dc8339eaac Add a test case covering the previous check-in to the test/fuzzdata8.db file.
FossilOrigin-Name: 95379da0e1ad5110648a5b3af24e7caab66a6f1ad6efdf374c83ae4ef1fed515
2020-06-16 14:12:43 +00:00
dan
b65ce39607 Fix an assert() in fts3 that can fail when processing a corrupt record.
FossilOrigin-Name: a58a6d6fb241a50c4c7c9af8a9c65bc4746e905b2ae12290c7182afa944053a2
2020-06-16 14:06:20 +00:00
drh
346a70ca1e Provide "sqlite_schema" as an alternative name to the table that holds the
database schema.

FossilOrigin-Name: 61782a7ae3c25cf59d7a676cb295eb024d17c46e532ae78c6fe871a91d712fa9
2020-06-15 20:27:35 +00:00
drh
b7cbf5c1b2 Fix a defect in the query-flattener optimization identified by
ticket [8f157e8010b22af0].

FossilOrigin-Name: 10fa79d00f8091e5748c245f4cae5b5f499a5f8db20da741c130e05a21ede443
2020-06-15 13:51:34 +00:00
drh
86d2de2571 Check-in [1d4f86201dab9a22] changed a testcase() to an assert() because we
didn't know how to reach that condition any more.  But YongHeng's fuzzer
found a way.  So now we change it back.  Ticket [9fb26d37cefaba40].

FossilOrigin-Name: 90b1169d1b200d35a3f9f0ad2ae35a1b336bdd9b1ad0494ba80a382354c8d8b8
2020-06-14 13:40:13 +00:00
dan
cd653a3266 Avoid deleting expression nodes in the flattener code, as they may be referenced by AggInfo objects further up the stack.
FossilOrigin-Name: cc1fffdeddf422404170fa163ab80372ae58b444d7012b2c164021b221709b3e
2020-06-13 21:24:40 +00:00
drh
74e0d96695 Identifiers "TRUE" and "FALSE" cannot take on their boolean constant values if
they are operands of the "." operator.

FossilOrigin-Name: ad738286e2441b5e84d05366db3fcafabe66be766f21fe6c17f43a8fabab16fb
2020-06-13 03:18:21 +00:00
drh
0dc90d43e5 New test case added to test/fuzzdata8.db.
FossilOrigin-Name: 14a5cbddc887e23a684fabab1a213cce261bd6cffa0663d4f138b92d0b65b9c2
2020-06-12 15:45:02 +00:00
dan
56e38185fe Fix a buffer overread in fts3 that could occur when decoding a corrupted record.
FossilOrigin-Name: 9a4a40c45feb2bb89020dc7711b4753479112ceae7ce2a44521d72afeddfac83
2020-06-12 15:17:27 +00:00
drh
6aa7515c46 Remove a NEVER() that turns out to be reachable.
FossilOrigin-Name: 44e573ecd5c2b60107133d60c51f3a04a3f904e9c1cf926e9b8ea977c7acae8d
2020-06-12 00:31:52 +00:00
dan
46daa99b8d Avoid rewriting compound SELECT statements that use a different collation sequence for ORDER BY and record processing a second time if they contain window functions. Fix for [b706351c].
FossilOrigin-Name: 32a88bdd4be5acdc1b80856bf6e32724dc3a467d5050bec0fe1a3dfedcc06f34
2020-06-11 15:53:54 +00:00
dan
f65e379919 Ensure that the "push-down" optimization does not push constraints down into compound queries if any of the component queries uses window functions.
FossilOrigin-Name: 094dcfe779613301521e8bb990432df187b3686add75a3420b4a193f02f3467f
2020-06-10 10:58:15 +00:00
dan
ed41a96bc1 Ensure that aggregate functions that (a) are part of SELECT statements with no FROM clause and (b) have one or more scalar sub-selects as arguments are assigned to the correct aggregate context.
FossilOrigin-Name: 16a41fa8c4c74bba4e908a9c19e6cf5a927cac140e2070c9abf303158be7257b
2020-06-09 17:45:48 +00:00
dan
cfb8bf6a50 Modify a test file to avoid causing Tcl to allocate too much memory.
FossilOrigin-Name: 232431f32ef77a9dfc4eeb7765dca24af72051fd5460f648d0c5ba318c8a01fc
2020-06-09 13:53:56 +00:00
dan
5c10930fa9 Fix a case where a corrupted fts3 record could cause an assert() failure, or spurious SQLITE_NOMEM error in builds with assert() disabled.
FossilOrigin-Name: d48af4d2cfff3d5f4ccc3db5d658e8b503255b577e6e62b5c2b4a4437875b895
2020-06-08 14:43:41 +00:00
drh
bf7909734a AggInfo objects might be referenced even after the sqlite3Select() function
that created them has exited.  So AggInfo cannot be a stack variable.  And it
must not be freed until the Parse object is destroyed.

FossilOrigin-Name: 3c840b4df306e2db1da08673e9ede973b4cb6d2b3f9eeeab5835e39452ee3056
2020-06-07 20:18:07 +00:00
drh
896366282d Alternative fix to ticket [c8d3b9f0a750a529]: Prior to deleting or modifying
an Expr not that is referenced by an AggInfo, modify the AggInfo to get its
own copy of the original Expr.

FossilOrigin-Name: 7682d8a768fbccfe0cc956e9f6481637146e1ab9763b248ff11052761ce32e32
2020-06-07 17:33:18 +00:00
drh
c060508445 Always use ?...? to indicate optional arguments in the output of ".help"
in the CLI.  Change ".mode column" so that it automatically activates
".headers on" if headers have not been previously turned on or off.

FossilOrigin-Name: 2827c0a186596299e43eb3e7378eea462d2b060b2c3388ce5cb2bc8e0b43999e
2020-06-05 00:54:27 +00:00
drh
0908e38536 Add support for "box" mode in the CLI: Like "table" except that it uses
unicode box-drawing characters instead of ascii-art.

FossilOrigin-Name: 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72
2020-06-04 18:05:39 +00:00
drh
094afffaec Improve the query planner so that it is better able to find full
index scan plan when there is an INDEXED BY clause.

FossilOrigin-Name: d901837fea1ed54de43ad59eb47c02cbfd2eb215fc57317b5ea8c22a7df947c4
2020-06-03 03:00:09 +00:00
drh
9776784f94 Fix the ".import" command of the CLI to clean up better after errors.
Add the new "shelltest" makefile target on unix platforms.

FossilOrigin-Name: 50d4ddf1330b88551de51439eb535f385dee6b53013802dd62f832d16b3025b6
2020-05-29 19:39:35 +00:00
drh
30c54a01db Progress toward adding new output modes to the CLI: json, table, and
markdown.

FossilOrigin-Name: 14f55fafec11491e87e6526c72cf85c689d74ba18418a1ae9646586ec206767a
2020-05-28 23:49:50 +00:00
drh
56c65c92cb When the sqlite_stat1 data is missing for some indexes of a table but is
present for the table itself or for other indexes in the same table, then do
not let the estimated number of rows in that table get too small, as
doing so can deceive the query planner into ignoring a perfectly good index.

FossilOrigin-Name: 98d4262018a81a9a36dd8beb4b02ff0e75cdcbb8a121d143157ffb37b228d60d
2020-05-28 00:45:16 +00:00
drh
c37577bb2d When rewriting a query for window functions, if the rewrite changes the
depth of TK_AGG_FUNCTION nodes, be sure to adjust the Expr.op2 field
appropriately.  Fix for ticket [7a5279a25c57adf1]

FossilOrigin-Name: ad7bb70af9bb68d192137188bb2528f1e9e43ad164c925174ca1dafc9e1f5339
2020-05-24 03:38:37 +00:00
drh
dd6c33d372 Limit the "precision" of floating-point to text conversions in the printf()
function to 100,000,000.  Fix for ticket [23439ea582241138].

FossilOrigin-Name: d08d3405878d394e08e5d3af281246edfbd81ca74cc8d16458808591512fb93d
2020-05-23 19:58:07 +00:00
drh
4f1315a432 Back out the change from [7fab1393c2b22b1f] that tries to convert invalid
surrogate characters in UTF16 into the replacement character 0xfffd, as we
find that this breaks some software.

FossilOrigin-Name: 4218c7b71fb6b227dbe4b852718584c150164af2d84e067cb810aa602554a609
2020-05-20 15:02:04 +00:00
dan
becd68ba0d Fix a use-after-free bug in the fts3 snippet() function.
FossilOrigin-Name: 0d69f76f0865f9626078bee087a22fb826407279e78cf9d5382e1c985c9f64a9
2020-05-16 17:26:58 +00:00
drh
bbf6d4328e Adjust some requirement marks. No changes to code.
FossilOrigin-Name: 7285ae2ce8fb1439e1acea2ec321abbc76aab0a2e84b58683fddb0a7bf74fb1b
2020-05-15 15:03:51 +00:00
dan
2629adc7b2 Update test file e_fkey.test to account for the fact that new columns with REFERENCE clauses and non-NULL default values may now be added using ALTER TABLE if the table is empty.
FossilOrigin-Name: 4087fce97252beda2456164afe9508f952fc9fe4be68ad0e9b330569a78e42f2
2020-05-15 13:52:33 +00:00
dan
a796de8300 Test script changes to account for the fact that the "p5" column in the EXPLAIN output is now an integer, not a text values containing a 2-digit hex value.
FossilOrigin-Name: 102126d80872fdb7469233611cab28100c8455aab4ce25702b83398394559185
2020-05-15 11:26:31 +00:00
mistachkin
a8e41ecaca Enhancements to long-path support in the Win32 VFS.
FossilOrigin-Name: 0119d96decd344ae711388ac8475b92464a6d018ecf73862170f137410036dac
2020-05-15 01:18:07 +00:00
drh
043c8f60a8 Move some new test cases from fts3snippet.test into fts3snippet2.test.
FossilOrigin-Name: fa203999944133941a38e5c858f1f66fc1ef4d2f33222ab81cbf4e3fc1539f1c
2020-05-15 01:13:46 +00:00