409 Commits

Author SHA1 Message Date
dan
165921a742 Changes to support recursive triggers.
FossilOrigin-Name: 9b9c19211593d5ff7b39254a29c284560a8bcedb
2009-08-28 18:53:45 +00:00
dan
69f8bb9c72 If a binary operator in a WHERE clause that should be performed with no affinity conversions applied to its operands (see http://www.sqlite.org/datatype3.html) is optimized by index lookup, do not apply any conversions to the key value before looking it up in the index. Fix for 93fb9f89d6.
FossilOrigin-Name: e72186f2d68d28c2e0c32894f9adb28c155b5f63
2009-08-13 19:21:16 +00:00
drh
eeb844a7f1 Suppress various compiler warnings. (CVS 6963)
FossilOrigin-Name: 257e9b575029f63277ed602d1402f87cfa15d22e
2009-08-08 18:01:07 +00:00
danielk1977
c7538b5f63 When extracting values from a record to use in an UPDATEd version of that record, apply OP_RealAffinity if required. Fix for #3992. (CVS 6945)
FossilOrigin-Name: 3616766a6f5c8179cc55444c29ecf29cc69f88ce
2009-07-27 10:05:04 +00:00
danielk1977
595a523a10 Allow virtual tables to be used in shared-cache mode. (CVS 6928)
FossilOrigin-Name: 5d9e767a05e381235e064061043e30cc03a11a07
2009-07-24 17:58:53 +00:00
drh
0b9f50d8aa Enhance autoincrement so that it works with triggers that also do
autoincrement inserts, even multiple inserts into the same table.
Ticket #3928 (CVS 6807)

FossilOrigin-Name: 1330993de8eae7baeec24100216158063c9bdc19
2009-06-23 20:28:53 +00:00
drh
33e619fc1c Additional refinements to Expr handling. Restore compression of trigger
expressions.  Change Expr.zToken to Expr.u.zToken and added Expr.u.iValue.
Remove an unnecessary ExprDup from CHECK constraint processing.  And so forth. (CVS 6682)

FossilOrigin-Name: 4ac2bdfbb4230b6ceaae87e738fa61036bbe03cb
2009-05-28 01:00:55 +00:00
drh
b7916a78ff Simplifications to the Expr object: Remove Expr.span completely and convert
Expr.token into a char* Expr.zToken.  Also simplify the Token object by
removing the Token.dyn and Token.quoted fields. (CVS 6681)

FossilOrigin-Name: 7cb1c3ba0759539cb035978fdaff6316775986f3
2009-05-27 10:31:29 +00:00
drh
24fb627afa Record within the Token structure itself whether or not the token has
been dequoted.  This steals one bit from the length of a token and
thus limits the size of tokens to 1GiB. (CVS 6589)

FossilOrigin-Name: 12bcb03d9b9e1a31c1a3c67cbb4263cc0af2f3d0
2009-05-01 21:13:36 +00:00
drh
bbb5e4e073 Remove an always-true test from delete.c. Move the sqlite3OpenTable()
routine from delete.c to insert.c since it is not used in delete.c. (CVS 6571)

FossilOrigin-Name: 71756dc870910665ef5fdbc7343bc3eedbe3ce65
2009-04-30 00:11:09 +00:00
drh
336a5300de Get rid of the special RowSet processing in where.c and move that into
clients.  Added the WHERE_DUPLICATES_OK option to eliminate an unnecessary
RowSet during DELETE with a WHERE clause containing ORs. (CVS 6546)

FossilOrigin-Name: 98606bee9e41b8969fb639fc43864e230185ca43
2009-04-24 15:46:21 +00:00
shane
c0688ea172 Removed compiler warnings from MSVC builds. Ticket #3701. (CVS 6335)
FossilOrigin-Name: 5477833ec7f707ea9937d3fd6a6d8ab49f2016f1
2009-03-05 03:48:06 +00:00
drh
18209cd6e2 Fix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT option for the new Expr compression
logic of check-in (6305).  Bug discovered during regression testing. (CVS 6333)

FossilOrigin-Name: 91969edac737adf087e35e10aa0a732b3303afd5
2009-03-02 14:24:21 +00:00
danielk1977
2f886d1d53 Instead of linking temporary triggers on non-temporary tables into the Table.pTrigger list, search the temp schema for them on demand. Fix for #3688. (CVS 6329)
FossilOrigin-Name: 3befe1ef7e6ebddedfa69579553a1b85b411ee98
2009-02-28 10:47:41 +00:00
danielk1977
2d2e7bd32e Reverse commit (6315) for now. (CVS 6317)
FossilOrigin-Name: 0e7c369c23a8767b4d3e5cdd47c14716992fb71a
2009-02-24 10:14:40 +00:00
danielk1977
e2d7b24d08 Scan an index instead of a table for "SELECT count(*) FROM <tbl>" queries. Because an index is usually smaller than a table on disk, this saves some IO. (CVS 6315)
FossilOrigin-Name: 294ba6f743c9132dce0e73da480bd3c2071e7239
2009-02-23 17:33:49 +00:00
danielk1977
d336e222f4 Instead of using SetNumColumns, specify the number of columns in a table or index using the P4 argument. (CVS 6310)
FossilOrigin-Name: e43ed649630cbc49a6f2a25a26a4a6b5fce84c48
2009-02-20 10:58:41 +00:00
danielk1977
6ab3a2ec8a Changes to reduce the heap space consumed by triggers, views and tables in the in-memory representation of the schema. Also to reduce the space used by prepared statements slightly. (CVS 6305)
FossilOrigin-Name: d9f6ffbc5ea090ba0daac571fc9a6c68b9c864e4
2009-02-19 14:39:25 +00:00
drh
23d04d5a20 Continuing improvements to the multi-index OR-clause optimizer. Added a
few simple test cases. (CVS 6062)

FossilOrigin-Name: 55d4f493e7df8515574a75caec9967d6c71b6012
2008-12-23 23:56:22 +00:00
drh
1bd10f8a00 Additional work at eliminating silly compiler warnings. (CVS 6010)
FossilOrigin-Name: ea01d43788a75e39c7f03c22681d1a338d52cf0e
2008-12-10 21:19:56 +00:00
drh
ea6788322e Never use strlen(). Use our own internal sqlite3Strlen30() which is
guaranteed to never overflow an integer.  Additional explicit casts to
avoid nuisance warning messages. (CVS 6007)

FossilOrigin-Name: c872d554930ecf221ac2be5f886d5d67bb35288c
2008-12-10 19:26:22 +00:00
drh
3d4501e573 Replace the VDBE Fifo object with the new RowSet object. (CVS 5977)
FossilOrigin-Name: 39a0750b49cf55e9c0927169ca47db909f5c16ea
2008-12-04 20:40:10 +00:00
danielk1977
62c14b3487 Changes to avoid "unused parameter" compiler warnings. (CVS 5921)
FossilOrigin-Name: 88134322c36b41304aaeef99c39b4ef5b495ca3b
2008-11-19 09:05:26 +00:00
danielk1977
10fb749b37 Change the way sqlite3VdbeSetColName() is called so as to remove a few lines of code. This also fixes #3470. (CVS 5853)
FossilOrigin-Name: bfce91429b1dad6e0ca36929e41a7adfb30f8522
2008-10-31 10:53:22 +00:00
danielk1977
52bd7912af If an SQLITE_DELETE authorization callback returns SQLITE_IGNORE, proceed with the delete operation but disable the truncate optimization. (CVS 5845)
FossilOrigin-Name: 65a2e131732399f0f14f982eb0689482fdb87b6c
2008-10-27 15:34:32 +00:00
danielk1977
c7af484b4b Make sqlite3_count_changes() and total_changes() work with "DELETE FROM <table-name>". (CVS 5844)
FossilOrigin-Name: e68e4282adb9003aa297d033aeb5d9cadee215cd
2008-10-27 13:59:33 +00:00
danielk1977
9a02fb444c Remove some if() conditions that are always true from delete.c. (CVS 5843)
FossilOrigin-Name: 297ad90dd3a69002e6e4175e9e3938b3a627574d
2008-10-27 08:24:38 +00:00
drh
f8cecdab84 Add the SQLITE_OMIT_TRUNCATE_OPTIMIZATION option. Other unrelated
documentation enhancements. (CVS 5798)

FossilOrigin-Name: fab4940d54fd1e5459a3d0d9b64b491e6972fd8d
2008-10-10 23:48:25 +00:00
shane
49ffdbf47e Further simplifications of the code for the LIMIT clause on an UPDATE or DELETE. Added a few test cases to wherelimit.test. (CVS 5797)
FossilOrigin-Name: 282c6a46b25f4e4278fd4c8b0b1cde1de28d8f51
2008-10-10 18:25:45 +00:00
shane
b235db9c7b Re-factored memory allocation failure handling in the sqlite3LimitWhere() function based on failures in the mallocJ.test script. (CVS 5791)
FossilOrigin-Name: 43507bbefbf79e8db8fe31319ad621d48247983f
2008-10-10 13:35:57 +00:00
shane
273f619b58 Updated LIMIT support for DELETE/UPDATE. Omit option changed to SQLITE_ENABLE_UPDATE_DELETE_LIMIT. (CVS 5788)
FossilOrigin-Name: c10e8a3c7ab7f21c95f24d0aba590f5b18a4b028
2008-10-10 04:34:16 +00:00
shane
4281bd4204 Initial support for LIMIT clause on DELETEs and UPDATEs. Changes likely with more testing. The code can be omitted with the define SQLITE_OMIT_UPDATE_DELETE_LIMIT. (CVS 5774)
FossilOrigin-Name: 9c8b132e34bc6024bc9898182f8f93127ca52ac9
2008-10-07 05:27:11 +00:00
danielk1977
b1c685b0c8 Allow INDEXED BY and NOT INDEXED to be used in UPDATE and DELETE statements. (CVS 5772)
FossilOrigin-Name: 83a7e446b2d4846a6f92bd831a2adaa265f5a786
2008-10-06 16:18:39 +00:00
danielk1977
85574e31cb Allow INDEXED BY and NOT INDEXED clauses in SELECT statements. (CVS 5766)
FossilOrigin-Name: 98ca5580f5acd2e7b3ce512520ec0527f221505e
2008-10-06 05:32:18 +00:00
shane
fa4e62f3d8 Omit prototype for and calls to sqlite3MaterializeView() if !defined(SQLITE_OMIT_VIEW) && !defined(SQLITE_OMIT_TRIGGER). (CVS 5655)
FossilOrigin-Name: 9cf484fc17944ffa14335e391112d82d2390d116
2008-09-01 21:59:42 +00:00
drh
8b213899e8 Avoid reevaluating WHERE and ORDER BY expressions that alias terms in the
result set.  Ticket #3343.  Note that aliased GROUP BY expressions are still
evaluated twice. (CVS 5637)

FossilOrigin-Name: ab0292caa5887cc1bdc0e8c9d3f3502b83975440
2008-08-29 02:14:02 +00:00
drh
2a5d825ea2 Allow the WHERE clause in an UPDATE or DELETE against a view with an
INSTEAD OF trigger to refer to the view by name.  Ticket #3298. (CVS 5589)

FossilOrigin-Name: 7360e5d1f37ed6672f336b625b3c90d060e0a020
2008-08-22 12:30:52 +00:00
drh
7d10d5a6e1 Refactor the name resolution procedures in the code generator. (CVS 5569)
FossilOrigin-Name: daf730d1defa78fb8b80a78f9108ac35a13e09f6
2008-08-20 16:35:10 +00:00
drh
633e6d57d9 Implement the "lookaside" memory allocation cache. Use of this cache makes
the speed1.test script run about 15% faster.  Added new interfaces to
control the cache. (CVS 5488)

FossilOrigin-Name: e48f9697e9fea339e150ddc32940760027dd07d9
2008-07-28 19:34:53 +00:00
drh
a9671a22b3 Remove obsolete code from select.c, including the "affinity" parameter
to the sqlite3Select() module. (CVS 5380)

FossilOrigin-Name: cbd3c1585b7a8f8042aa1448fe1be87de056c41a
2008-07-08 23:40:20 +00:00
drh
4f3dd1502e Make sure that transactions are started on all virtual tables that
changes in a single statement, not just the first.  Ticket #3083.
Need to add test cases. (CVS 5063)

FossilOrigin-Name: 133b7ee50ea6012739ebe0e334374c5d9b1fcc7f
2008-04-28 18:46:43 +00:00
drh
f93d99990c Do not attempt to omit unused columns of a view in an instead-of trigger
since sometimes those columns can be used in ways that we do not expect.
Ticket #3055. (CVS 5012)

FossilOrigin-Name: f5fc42e96d36b78797d7fa10b01d22b8501112b1
2008-04-15 14:36:42 +00:00
drh
3a200e0a44 Avoid the use of uninitialized variables in sqlite3GenerateRowIndexDelete.
Ticket #3048. (CVS 4991)

FossilOrigin-Name: a93b7a344a713a9ed9d72be4707eb28c2979648c
2008-04-11 19:18:24 +00:00
drh
da250ea599 Fix the CSE mechanism so that it takes into account column affinity
changes that might be imposed by comparison operators. (CVS 4949)

FossilOrigin-Name: 91cc646e2b0c1d62a1989405cc9384a2c22d98d0
2008-04-01 05:07:14 +00:00
drh
e55cbd7228 Avoid duplicate OP_Column opcodes by remembering prior results.
This is similar to CSE, but only applies to columns. (CVS 4943)

FossilOrigin-Name: c29ee0fed23dcdbd9dde6b1e42b603100ea2389c
2008-03-31 23:48:03 +00:00
drh
e14006d0de Modify the {quote: IdxDelete} opcode so that it takes an array of registers rather
than a record formed using {quote: MakeRecord.}  This avoids a needless packing
and unpacking of the record to be deleted. (CVS 4916)

FossilOrigin-Name: ee381b43563e1b0637ee74389d076dff77deddf9
2008-03-25 17:23:32 +00:00
danielk1977
cd3e8f7ce9 Use a vdbe memory cell to allocate the space required for vdbe cursors. (CVS 4912)
FossilOrigin-Name: 047153648155654b0cd70b811935209d2e21776c
2008-03-25 09:47:35 +00:00
drh
f39d958829 Undefine the "isView" macro when compiling with SQLITE_OMIT_VIEW so that
the macro does not interfer with subsequent modules in the amalgamation. (CVS 4888)

FossilOrigin-Name: a42caa8f83ce19af1e569c4545ea8b2449152430
2008-03-19 20:42:13 +00:00
drh
0f35a6b529 When materializing a view for an UPDATE or DELETE make use of the WHERE
clause to limit the number of rows materialized.  Ticket #2938. (CVS 4782)

FossilOrigin-Name: 5ab71c3a79cac04cb2c576f83a62218d05571006
2008-02-12 16:52:14 +00:00
drh
ca4241140c Error messages says "no such view" instead of "no such table" when
trying to DROP a VIEW that does not exist. (CVS 4750)

FossilOrigin-Name: 50815a82e0ec9a5c1399f5fe6ef416434b55a821
2008-01-25 15:04:48 +00:00