Commit Graph

19588 Commits

Author SHA1 Message Date
drh
c840b428fc Merge fixes and enhancements from trunk.
FossilOrigin-Name: 589186c083ff3af8d5a6d5ad34e1cefea57806ebf3831ea3bf5a48ef1e173140
2018-09-01 15:49:13 +00:00
dan
6ae2454a67 Update test script snapshot_fault.test to account for the new
sqlite3_snapshot_open() error code.

FossilOrigin-Name: c1aca7673ab04740bc8ad76af0a72a229c79a0cd51cf84d1c689a77424ff17c6
2018-09-01 06:13:07 +00:00
drh
28d46eed3f New hyperlink on the README.md file.
FossilOrigin-Name: c663961e34ec03ef76aabc9741f37d19544826e3e0b5931711313fc088e9e62c
2018-08-31 23:22:40 +00:00
dan
8d4b7a3fa8 If a call to sqlite3_snapshot_open() fails because the requested snapshot no
longer exists, return SQLITE_ERROR_SNAPSHOT instead of SQLITE_BUSY_SNAPSHOT.

FossilOrigin-Name: e07923128bb164efbafde29d49175b61f2ef44b2dfac5ae4ed61937945dfcf4c
2018-08-31 19:00:16 +00:00
dan
141e119a17 Ensure b-tree mutexes are always held when sqlite3FindTable() is called. Do
not invoke the authorizer callback when parsing schema items as part of ALTER
TABLE commands. Fix test script issues.

FossilOrigin-Name: eac2aa7dce577f1998cc2078dd8ac384070f8acf1ceb565999a5cf719092024e
2018-08-31 18:23:53 +00:00
drh
876c7ea3fa Try to identify the places in WAL code where thread-safety depends on the
underlying architecture supporting atomic load and store of aligned 32-bit
values.

FossilOrigin-Name: 47d44be4a68d377d0049a12b2587dbbcc0870b469473e1098f7c0358fe8c7532
2018-08-30 20:28:18 +00:00
dan
9d324823a8 Test the schema after renaming a table. Ensure that temp database triggers and
views are updated when renaming a column.

FossilOrigin-Name: f3c27d916d4837f8fc3dd812bd004535f04c7a53bd2a0a2419613275f48bec76
2018-08-30 20:03:44 +00:00
drh
ed9272159e Give the debugging routine print_pager_stats() external linkage in order to
suppress harmless compiler and TSAN warnings.

FossilOrigin-Name: ff4dc08298ab3988e69fe60802657791f65d2af15f4b1cbd1d02649bc597d0d6
2018-08-30 18:53:09 +00:00
dan
0ccda96867 Fix an ALTER TABLE problem with processing temp schema views and triggers.
FossilOrigin-Name: 72cfb1be29971d91a164f1d4f20cb054de68960a0bd547630bcd1160565971c5
2018-08-30 16:26:48 +00:00
drh
e35fc302c3 Improved JSON parser caching.
FossilOrigin-Name: 58078c0d2647a194279fa80e032670441b296ffc3acee692901faa5beca460b7
2018-08-30 01:52:10 +00:00
drh
9c1d7c6d4c Additional test cases for geopoly.
FossilOrigin-Name: 19b5eb45e090c4b7169a52d881495ee2eafc59f80e3db2288fc1814ba76134ac
2018-08-29 21:01:22 +00:00
dan
c9461ecc28 Extend RENAME TABLE to edit triggers and views. Still buggy.
FossilOrigin-Name: 01308bae3acf33f78b5bb90892085eab340df093aafc17e6ccf6a7d6cf324897
2018-08-29 21:00:16 +00:00
drh
17f19eadb8 Fixes to the UPDATE logic in Geopoly.
FossilOrigin-Name: 7c3cee0a2a5ccacff27400c38bd708f7b9b968eb013a8fa685d876dfe85e12a6
2018-08-29 20:52:40 +00:00
drh
9d67afc421 Also free up the MEM_RowSet bit in the Mem.flags field and have RowSet objects
be destroyed using Mem.xDel.  This change results in faster code.

FossilOrigin-Name: f48e9feb3fca514e4e586932e6d19a5e34a384204effeba553006dcddf5f13d2
2018-08-29 20:24:03 +00:00
drh
72f56ef95d Free up the MEM_Frame bit in Mem.flags object. Store VdbeFrame objects
as MEM_Blob with a special Mem.xDel pointer instead.

FossilOrigin-Name: 62db5fd47660bbc4fcf2c6d4a6c5a3077f12c6442a128d22b66b789a0409ef32
2018-08-29 18:47:22 +00:00
drh
c0d2117f1c Add the geopoly_group_bbox() aggregate function to the Geopoly module.
FossilOrigin-Name: 2d4debccbc027405a33aeb10f9d65f6fe4bfb5eb1be5a4d8b82158caba04643f
2018-08-29 15:50:47 +00:00
drh
8ab114c6a9 Disable the server1.test script on old PPC Macs due to problems in the
pthreads implementation on those archaic machines.

FossilOrigin-Name: 43efdd8c7e468405c9d4956a8caa66548059499289cbcc091628de7b055268cd
2018-08-28 21:12:02 +00:00
drh
58726ca4b9 Stricter enforcement of the JSON and GeoJSON standards in the Geopoly extension.
FossilOrigin-Name: c0bf3ff3af4d34ef7801c16e39128e894b00699313f4915f57aa73b57642f7fd
2018-08-28 19:23:41 +00:00
drh
79931a1517 Fix new issues in the geopoly module discovered by TH3.
FossilOrigin-Name: 22fff9afc2fb20906173f258aa8feae9b52acc69a0ca7baf4e914d29c4279a23
2018-08-28 15:51:10 +00:00
dan
f5778751f7 Fix a problem causing spurious SQLITE_CORRUPT errors when using the snapshot
API to read from old database snapshots.

FossilOrigin-Name: 535155be584ad8c1836e6b1c62de836d9872056d39608c995221c928cb5b365d
2018-08-28 11:23:52 +00:00
drh
5965fed24e Add support for the Geopoly extension to the R-Tree extension. This also
involves adding the SQLITE_INDEX_CONSTRAINT_FUNCTION capability to the 
xFindFunction method of the sqlite3_module object, and to the
sqlite3_index_info.aConstraint.op field in the xBestIndex implementation of
virtual tables.

FossilOrigin-Name: 666133e32ca8e95807f8437dc8401bc93e2e6508ab8e6ae1e6031b7cee1584ae
2018-08-27 17:13:12 +00:00
drh
74e0aaece1 Minor changes to the visual01.txt test script.
FossilOrigin-Name: 4bc28eed32154be0e62fe69acd30f828c2e6f59c6579618ecad8ecf632a90517
2018-08-27 17:05:59 +00:00
drh
b2a18c95f0 Split the three-argument version of geopoly_within() off into a separate
function named geopoly_contains_point().

FossilOrigin-Name: 5a0e1541037b5bbc1b4bf26a7da304c9b32ea72960aca8b9309cf2180757c8a4
2018-08-27 15:55:37 +00:00
drh
e6474b77b8 Enhance the geopoly virtual table so that it does a better job of optimizing
geopoly_within() queries.

FossilOrigin-Name: 1f717385340f295064a7649cfc36ad048573cbacb6faa20f5c6067328c40c745
2018-08-25 23:03:27 +00:00
drh
27d62540e5 Provide the two-argument geopoly_within(P1,P2) routine that determines if
polygon P2 is contained within polygon P1.  Make this function available to
the query planner for optimized rtree lookups.  Update the visual01.txt
script to verify that the new functionality actually works.

FossilOrigin-Name: 6eb5d09b7f9d9bf8edbf993dccc2e2f702b95ba96cf68445609feb0ccc3ac0f7
2018-08-25 19:51:49 +00:00
drh
95327f539b Fix a harmless compiler warning.
FossilOrigin-Name: d49be9838d237b57ba1f12ed00e2d3411314ee1b9c30ef7bbaf65aca20d0870e
2018-08-25 18:57:12 +00:00
drh
3a843f525c Remove an unnecessary IN_RENAME_COLUMN macro from resolve.c.
FossilOrigin-Name: 5858c0bde7c210f07cfa72cee95325847b26733abab4f56301b57cd816931e97
2018-08-25 03:29:34 +00:00
drh
da76adc085 The implementation of sqlite_rename_column() must be holding the
schema mutexes.

FossilOrigin-Name: f0eed21d4e2e1f2c8e680a510a283ac21156c9766efec5b80a362a040424bce7
2018-08-25 02:04:05 +00:00
dan
aa42e9816b Fix a problem by renaming a column when the schema contains an trigger program
featuring an UPSERT that uses an "excluded.*" reference to a different table.

FossilOrigin-Name: 83d5f5abce6be2f6d342a6fc68839289400d7bcb80eaa38194789142c93a80c3
2018-08-24 20:20:33 +00:00
dan
85a9d508df Fix a problem with renaming a column that occurs as an "excluded.colname"
construction in an UPSERT that is part of a trigger program.

FossilOrigin-Name: bb2f7234968157b605522dea8e115d8772ab4234147894089d6e48fedf5d6a5d
2018-08-24 20:10:22 +00:00
mistachkin
88edc6c72a Set SQLITE_PTRSIZE to 4 when compiling with xlc on 32-bit AIX.
FossilOrigin-Name: d158e5b12eec5b81d54c8f5902a972795423947a21d0212b6cceb2810aa6cc5c
2018-08-24 19:04:08 +00:00
dan
0d5fa6b979 After modifying and reparsing the schema as part of an ALTER TABLE RENAME
COLUMN, check that no new schema errors have been introduced (e.g. ambiguous
column names in views) before committing the operation.

FossilOrigin-Name: a0e06d2c5e3abb3f300491e7651bb177a436899efd4506de9239359096b6a9e7
2018-08-24 17:55:49 +00:00
dan
1b0c5de434 Avoid incorrectly replacing tokens that refer to a column being renamed via an
alias. For example, do not overwrite "xyz" when "a" is renamed in "CREATE VIEW
v1 AS SELECT a AS xyz FROM tbl WHERE xyz=1"

FossilOrigin-Name: ad072a835f97ff418f5919d94f547ce8afb4fc7c7b590deba41f1e62136a79ac
2018-08-24 16:04:26 +00:00
drh
355f2e02e9 Add the "atrc" test program to the Makefiles. Fix a typo in the instructions
in the header comment of the atrc program.

FossilOrigin-Name: 2130a407ddd8cdf3d29b109d773686c84906d9dc1663376e94e191086d524c9e
2018-08-23 20:09:19 +00:00
drh
79a5ee93c7 Fix harmless compiler warnings in the ALTER TABLE logic. Rephrase an
error message to use active voice.

FossilOrigin-Name: a7dae59a7e7b187fa2e9457bbb4b01cfe3d48bbdf59c3f8f7b4156bcde3bda98
2018-08-23 19:32:04 +00:00
drh
ba3a4072b4 Automatically detect when compiling for AArch64 on windows and set
SQLITE_BYTEORDER to little-endian to avoid compile-time testing.

FossilOrigin-Name: ef6729be85ed106212ed23a024d83b85b709207cf287436c0603a21c659f36ad
2018-08-23 18:56:33 +00:00
drh
d3130dab92 The Expr.iColumn field must also be initialized in tokenExpr().
FossilOrigin-Name: 772985f18b2ab8fa04a0c29593fc6d9b74c1361260cb59e566606dd56f326535
2018-08-23 18:50:19 +00:00
drh
4fe759b2cc Make sure the Expr.iTable field is initialized by tokenExpr().
FossilOrigin-Name: 02a05a3b3c6440432fc15daa14678a6eba40759e17e43ae8d63d19a0842de56a
2018-08-23 18:22:00 +00:00
drh
a961d3a198 Merge enhancements from trunk.
FossilOrigin-Name: c446c8841192054c97ba5003fb6185b135a687b36c10fe0986e627282955520a
2018-08-23 14:54:45 +00:00
dan
79e9d34764 Fix a test case that was failing for SQLITE_ENABLE_STAT4 builds.
FossilOrigin-Name: 1e29fd430dead641c5d92943ce81cf51b3df2f45c5a011bb2eed592efd62e056
2018-08-21 17:03:25 +00:00
dan
07e9523364 Rename internal function sqlite3RenameToken() to sqlite3RenameTokenMap() and
sqlite3MoveRenameToken() to sqlite3RenameTokenRemap().

FossilOrigin-Name: b9ae9a0a188b82d7066f6ef7d21592889df0a61559e9a0e01819e9d5a92c3f36
2018-08-21 16:32:53 +00:00
dan
0624939818 Rationalize some duplicated code in alter.c. Also improve error messages for
ALTER TABLE RENAME COLUMN in some cases.

FossilOrigin-Name: 5d2163c734aea8c0e1611af1161734bf141e7bd02c08f0b5f2e7bac3c7dfd2a5
2018-08-21 15:06:59 +00:00
drh
f396ecadcd Further attempts to reduce the number of false-positives genenerated by
static analysis tools.

FossilOrigin-Name: 38f9ce6503c4dd05ccdd73463b1784a6df7ed6e5018c29c5874a3681ca34ba54
2018-08-21 12:46:34 +00:00
drh
c4ceea72b7 Fix various harmless warnings generated by static analysis tools.
FossilOrigin-Name: a04a0ea9e30e0ef12bafa0b90b7d1b7764865768bb4a738b0c73a7a3ef9416db
2018-08-21 12:16:33 +00:00
dan
d145e5f46f Minor changes to function tokenExpr() in order to claw back cycles lost to the
rename-column change.

FossilOrigin-Name: 479976955ecb27c3e77a280187eaf23722178549e072b34f3183354a27a4e5c3
2018-08-21 08:29:48 +00:00
dan
b013738b4c Add further tests for RENAME COLUMN.
FossilOrigin-Name: 82c4c10a96db76f39edf5f6d027294d449d75b5a18da70da3667786da90e184d
2018-08-20 20:01:01 +00:00
dan
9d70557e80 Ensure that it is not possible to rename columns of system tables, views or
virtual tables.

FossilOrigin-Name: 786b5991dc0bb6ba13327a3ac9d04efbf8b591dedc736b719b206ffd865b1918
2018-08-20 16:16:05 +00:00
drh
38d9964a73 Additional fixes for harmless compiler warnings that are specific to this
branch.

FossilOrigin-Name: 9d8e73bf71e996b810959ffc0e60de69b5e8ca3301df52f9c35d5e9075921798
2018-08-18 18:27:18 +00:00
drh
2ee001ab39 Merge trunk fixes.
FossilOrigin-Name: ccad277927baa2c36d0b5a03832dc51d9a7f3071587f0da0f2c1b44885c82e8d
2018-08-18 18:14:02 +00:00
dan
c23f3cb15b Have ALTER TABLE RENAME COLUMN also edit trigger and view definitions.
FossilOrigin-Name: 7908e8a4a3b9577211a5d3da9c4142c46e9d5872be4a6499ec053f2b547019b8
2018-08-18 18:01:58 +00:00