aboutsummaryrefslogtreecommitdiff
path: root/src/attach.c
AgeCommit message (Collapse)AuthorLines
2026-10-05Handle temp triggers attached to databases clobbered by ↵dan-13/+19
sqlite3_deserialize() in the same way as those attached to DETACHed databases. FossilOrigin-Name: 84c773fcc2f785346fd12e8a17ac45f9068797d9629ddc367318994b6fed421b
2026-10-05Ensure that deserializing into a database expires existing prepared statements.dan-0/+1
FossilOrigin-Name: de0361b1caa97d36ea79a5bcb032539ccfb235c03581e0e88c54c03a321d7911
2026-10-05Ensure that eponymous virtual table objects are not left with dangling ↵dan-0/+5
schema pointers if the main database is overwritten using sqlite3_serialize(). FossilOrigin-Name: 18d2646f6fa56244be12122873cd9aa48b2074a22f0be637edfcc9b5de99158b
2026-04-27Fix a crash that could occur if sqlite3_deserialize() was used to overwrite ↵dan-2/+11
a database with an open transaction on it. Bug introduced by [fc42d31d6fca21ab] on 2018-03-07 and first released in version 3.23.0. This is not a vulnerability as an attacker that can exploit this already has the ability to execute arbitrary code. Forum post [forum:39134ba029 | 39134ba029]. FossilOrigin-Name: 77662cce9aa452ba5820e5f1a864a802763bd83b937cdb16e7025219eff7bd08
2025-10-29Experimental change to allow triggers in the temp schema to use fully ↵dan-1/+1
qualified table names in INSERT/UPDATE/DELETE statements. FossilOrigin-Name: 48e168007ceb1bdc54cf21a8e959a8e0f9ccdc478827db7a7a0518fc7a226401
2025-02-24Merge latest changes from trunk into this branch.dan-1/+1
FossilOrigin-Name: 55324d1c862c42b95251a398c40930d9fa94debb1aec7d3d0ae734d6b17b4a59
2025-02-17Code changes that make it easier to prove that no 32-bit integer overflowsdrh-1/+1
happen during memory allocation. No problems fixed; this change is just to make future maintenance easier. FossilOrigin-Name: 215650a5a1d55bdbca9c92524804a1a54456a17f42a17e53747b21a6507506f5
2025-02-11Merge latest changes from trunk into this branch.dan-0/+6
FossilOrigin-Name: e5ec5bb9f4dc3e02db7ab0e49686f47617af75d3f7d4ab23288a1aea4a693e59
2025-02-10Experimental change to allow clients to block when taking a SHARED lock to ↵dan-0/+7
connect to a wal mode database. FossilOrigin-Name: d2d6a000fb9bf8097e0ce9979685408d183be3ab785ceeb11ec1f97a81a83e41
2025-01-22Add two new sqlite3_db_config() options that enable the ATTACH commanddrh-0/+6
to create new database files and to open databases read/write. Both default to on for backwards compatibility. FossilOrigin-Name: fe0c58d00b491d1af7c0894f5c32542954aeea2e6510853b3bcbf13ac0bf5ce0
2024-10-28Remove the never-used and never-documented and long-ago deprecateddrh-9/+0
user-authentication feature option. FossilOrigin-Name: 3a3f7bf4307c27e56546e51da06ecc9a262cdf155fda2dd359aa2326d207a147
2024-08-19Refactor the SrcItem object so that information about subqueries is storeddrh-1/+1
in a separately allocated Subquery object. This reduces the memory requirements for SrcItem and makes the code run faster. It also provides an expansion path for subquery processing that does not burden simple queries. The current checking mostly works, but there are still issues that need to be tracked down and fixed. FossilOrigin-Name: 8ff5dda8448d7e1a533d7f27db2573ce68fa9956b9d9847ced45e83c1f06bab0
2024-08-17Reduce the size of the SrcItem object by combining fields into a union.drh-6/+7
FossilOrigin-Name: a4c59ac3c6ec979c25b544d29e47b8e39f6439c098eed8f84b3bd506c9adf047
2023-01-21Fix harmless compiler warnings.drh-1/+1
FossilOrigin-Name: ded60f5b3431283d70eb8c41761c0fa9727021e6309d0df0ae3fb0a5274c1299
2023-01-20Two branches associated with memdb are now always taken (I believe). Tagdrh-2/+2
them with ALWAYS() to verify this. FossilOrigin-Name: 20b9b5aa4fa6136059cf1123f00d86cb7bd8fb0f0f86f971e9714f22725e60b5
2023-01-20Ensure that the database encoding cannot be changed while there are ↵dan-5/+20
statements running. And that the connection is left in a valid state after an obscure OOM within sqlite3_deserialize(). FossilOrigin-Name: a02da71f3a80dd8e817e89cdaa775c95e38c90d2471f8fec516bed086539e2c0
2022-04-07Improved technique for parsing the ON and USING clauses of a join is fasterdrh-1/+5
and uses less memory. FossilOrigin-Name: 158156a3e3d50042cafc75dea3aaaa68b1f2efb9c3d178518ea6e68e32e0d21c
2022-01-24Add ALWAYS() macros. Change some existing ALWAYS() into assert(). Otherdrh-1/+1
code simplifications. FossilOrigin-Name: 4aa27b4fcd1ffd06c38357a87ba3f5776367570439c49652f0903873def0bb23
2021-10-07Protect all accesses to the FuncDef.u and Expr.u unions using nearbydrh-0/+1
assert()s or branches. FossilOrigin-Name: 9af863f065e0bef491c2ab7525194505f9516f4e6dfc789d2e3a9d2c2438533a
2021-10-04Fix harmless static-analyzer warnings.drh-3/+3
FossilOrigin-Name: 32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
2021-05-20Replace [0f0959c6f95046e8] with a new and better solution that also fixes thedrh-7/+10
CTE name resolution problem described in [forum:/forumpost/8590e3f6dc|forum post 8590e3f6dc]. Test cases for both problems added. FossilOrigin-Name: 5614279daff5007d6e047c5c1b3cc82ba80a5c91c529525b0fe68b79ee82dd2c
2021-05-08Enable the sqlite3_serialize() and sqlite3_deserialize() interfaces bydrh-1/+1
default. Omit the SQLITE_ENABLE_DESERIALIZE option and replace it with the SQLITE_OMIT_DESERIALIZE option. FossilOrigin-Name: 6df3b03e00b1143be8fed3a39a58ce81063020275aa1ac13d87c84f1ceda6e27
2021-04-21Fix a problem allowing SQL variables to be used expressions within the ↵dan-8/+10
second and subsequent ON CONFLICT clauses of an UPSERT within a trigger. FossilOrigin-Name: 2a28910a17dc5b3ce43062fdf879f9622f6ec2db19ed780fa7fe5cae781be7b7
2021-04-19An improvement to check-in [1a341378ab24a509] that omits the newdrh-2/+1
Walker.bWalkWinDefn boolean (which is not always initialized) and uses a special value for xSelectCallback2 instead. FossilOrigin-Name: bef2238de9550de84d4cd1c970a542b43db288d73d09a3c3ced7f98bb3188fd3
2021-04-17Ensure that variables are not used in the WINDOW clause of a query insidedrh-0/+1
of a trigger. dbsqlfuzz d9cf66100064952b66951845dfab41de1c124611 FossilOrigin-Name: 1a341378ab24a5091e6cf03b9e957d11b2bfe5c711835e8c583785f8fa0125d3
2021-02-21Rename the "struct SrcList_item" object to the more succinct "SrcItem".drh-1/+1
This is a symbolic change only. The logic is unmodified. FossilOrigin-Name: bfd5bf2c73110fcb36db9ba2a949ff516131fbd3e89325f88fe9f5c2b4ed87b2
2021-02-03Fix a harmless compiler warning.drh-1/+0
FossilOrigin-Name: 1eb69c64ed4a11601698000573c507684bc4b0366336ba0748ebd661644d0902
2021-01-21Fix a problem caused by using an SQL variable in an OVER clause within a ↵dan-114/+84
trigger program. FossilOrigin-Name: 4f676466e60ee2a420b7b2deace76f3a733ce1af278347428285715d9c67f022
2020-08-25Add support for the sqlite3_txn_state() interface.drh-1/+3
FossilOrigin-Name: ad195e3dd89d0f33b50070c18fb8f43c4eb24162515dfdd7c04d9e7d96b902a2
2020-07-14Support UPDATE...FROM statements in trigger programs.dan-0/+3
FossilOrigin-Name: 4f6d8d0ebf40029218a1d3b05ea657c0c5953b01c6f0b6a628465aa44c67e7f3
2020-03-21Simplify some of the code modified by the previous commit.dan-19/+3
FossilOrigin-Name: 04abadb545d1b34bdd74d62becb3bfd83aceee373fd6b4b708d5ad53f41d9464
2020-03-21Consolidate some code on this branch.dan-8/+20
FossilOrigin-Name: a85c63daa640e02fdfd891a05a1a09e848c9621a5dd6e112338451008623ecbb
2020-03-20Allow "main" to be used to refer to the main database even after ↵dan-3/+18
SQLITE_DBCONFIG_MAINDBNAME has been used to assign another alias. FossilOrigin-Name: 75c85ca32f9ae4a28fd8f8ff2f7639599413d22af706e9799a0e76cc560d14eb
2020-02-27Ensure that the filename passed into the xFullPathname method of the VFS isdrh-1/+1
acceptable as an argument to sqlite3_uri_parameter(). The interface spec does not guarantee this, but it has been so historically and some applications have come to depends on it. FossilOrigin-Name: bfb09371d452d5d4dacab2ec476880bc729952f44ac0e5de90ea7ba203243c8c
2020-02-07Simplify the code by removing the unsupported and undocumented drh-36/+0
SQLITE_HAS_CODEC compile-time option FossilOrigin-Name: 5a877221ce90e7523059353a68650c5fdd28ed032807afc2f10afbfbf864bdfe
2020-01-06Refactor names of flags for improved legibility.drh-3/+4
FossilOrigin-Name: 411e8ec2219bb4181aaf2209fb1e7baf5e8df8b8c8adb82a69b48cf7e8e7e7d4
2019-10-30Simplify the bytecode generation for SQL function calls such that thedrh-5/+2
OP_Function or OP_PureFunc opcodes are coded directly, rather than using the intermediate OP_Function0 or OP_PureFunc0 - opcodes that are now removed. FossilOrigin-Name: 84e02d773d60cffe619104991d21d7f0c68616c0f6bb99686bf54f5306c756d0
2019-08-27If a TEMP TRIGGER references an auxiliary schema, and that auxiliary schemadrh-0/+13
is detached, move the trigger to reference the TEMP schema before completing the detach, so that the trigger does not hold a dangling schema pointer. FossilOrigin-Name: 069c2f4c61f06211a8981abc412afcc1536ece13380b13a70aa99123f8f527cd
2019-08-15Provide the SQLITE_DIRECTONLY flag for app-defined functions that prohibitsdrh-0/+1
the use of those functions within triggers or views. FossilOrigin-Name: fc745845d8d76adc165575e2192f4176e3c28e614c72571d56f4011560499fe1
2019-04-15Fix a problem with the user-auth extension and deserializing in-memory ↵dan-1/+1
databases. FossilOrigin-Name: 09fa0b3c4adf7f81a777975762029ad43dbdc76b02dc32d2307e1c42465213c9
2019-03-13When deserializing a database (sqlite3_deserialize()), do not attempt to ↵dan-1/+3
parse the schema before the data is loaded. FossilOrigin-Name: 4e1b005e8b397a22161a6b89cbd3f17bda70a6e0a86d8abdc61856edf2a74da4
2019-02-02Honor key query parameters for SEE on the URI filename for ATTACH drh-6/+9
and VACUUM INTO. FossilOrigin-Name: 2e01096b8933a2315e3dffcd7d0de84c744c1b4be1d909388c61f0fd636ddb99
2018-11-13Turn on ASAN for the dbfuzz2 utility. Fix a buffer overread associateddrh-1/+1
with sqlite3_deserialize(). FossilOrigin-Name: 4e38f27b55030e908bd36f32101e26b30f10dbde67e12c8197d0363ee12aa06d
2018-11-05Eponymous virtual tables appear to exist in all schemas. This is an alternativedrh-3/+1
and improved fix to the eponymous virtual table in trigger problem that was previously addressed by checkin [1fa74930ab56171e]. FossilOrigin-Name: b8d35c4a7c99ce3753761e5b81269d52c3c910c603fa70b72549883ba68bc485
2018-11-02Enhance triggers so that they can use table-valued-functions that exist indrh-1/+3
schemas outside of the schema in which the trigger is defined. FossilOrigin-Name: 1fa74930ab56171e2e840d4a5b259abafb0ad1e0320fc3030066570a6dd10002
2018-06-14Fix problem with window functions min() and max() when used with a PARTITIONdan-2/+2
clause and a frame starting point other than "UNBOUNDED PRECEDING". FossilOrigin-Name: 43eb1e75a4d7ac0973ed8589bbaf379c24cdc8eacc4e613610d2d4c24d385dc1
2018-05-16Start of experimental implementation of SQL window functions. Does not yetdan-0/+2
work. FossilOrigin-Name: 3781e520854808fe02ad3fe77dd11fc917448c58ff1fd79123289dd91937decd
2018-04-25Avoid many unnecessary calls to sqlite3ReadSchema() and sqlite3Init() whendrh-1/+2
the schema is known to be valid already. FossilOrigin-Name: 58cf812fd81329e82b3fdd61b7ad2040c9b90d2d80f592b9231e0e1902c8d577
2018-04-23Ensure that there are no bind-parameters or incorrect schema references indrh-0/+12
the UPSERT portions of an INSERT within a TRIGGER. FossilOrigin-Name: d47a6bdda0ce967a7b70bc6eb56278c8b79525622381ff4adcf04525eafc1461
2018-04-11Prohibit bound parameters in the arguments to table-valued functions withindrh-0/+3
a trigger. Problem discovered by OSSFuzz. FossilOrigin-Name: b7178209152452e82f5908513385018524472640d67547927d6b4c0aa0c15a46