241 Commits

Author SHA1 Message Date
drh
193a6b4142 More rollback problems: Fix two more errors introduced by checking (410) that
can cause database corruption after a ROLLBACK.  Also add new tests to make
sure everything is working this time. (CVS 663)

FossilOrigin-Name: f6e24d5ccbcfcf5863ffbd65860dafa2f5663e99
2002-07-07 16:52:46 +00:00
drh
38640e15af All the code is now in place for SQLite to distinguish between NUMERIC and
TEXT datatypes.  Still need to turn on the new code and test it. (CVS 659)

FossilOrigin-Name: b4737a16c997a6c139d616211fb6bc4b0fae181c
2002-07-05 21:42:36 +00:00
drh
2f2c01e51d Fix for ticket #92: Correct the sqliteExprCompare() function so that is takes
into account the iTable and iColumn fields of the Expr structure.  Otherwise,
"min(a)" and "min(b)" will compare equal to each other in views. (CVS 658)

FossilOrigin-Name: 85793a4f03250166c21007cab3525709592d0866
2002-07-02 13:05:04 +00:00
drh
5ad1a6c8c4 Fix for tickets #90 and #89: Make the AS keyword optional again. (CVS 654)
FossilOrigin-Name: 1f8a73b1c3833e3924196458d4c1ecca90f63662
2002-07-01 12:27:09 +00:00
drh
6cbe1f1bc4 Added additional tests. No new errors found. (CVS 653)
FossilOrigin-Name: 8924a7f5bab790ab552332d6359028d0d1825e4a
2002-07-01 00:31:36 +00:00
drh
a9f9d1c08b Add a few more tests and fix a few bugs that the tests uncovered. (CVS 652)
FossilOrigin-Name: 91c0db66c86facb21b5b522afadd83d91a488256
2002-06-29 02:20:08 +00:00
drh
3b167c7583 Additional test cases added. The following bug fixed: A segfault was occurring
if a VIEW consisted of a join with a USING clause. (CVS 651)

FossilOrigin-Name: 96515b813eb57e1f48c28d357d1f38639b2fdcfa
2002-06-28 12:18:47 +00:00
drh
83dcb1ad37 Fix for ticket #84: If the WHERE clause is too complex, issue an error message
and refuse to do the SELECT.  The cutoff is a WHERE clause with 100 terms. (CVS 650)

FossilOrigin-Name: c07e493b62125e85eaea36b6945f1e146e2792b8
2002-06-28 01:02:38 +00:00
drh
411995dc0d Add the sqlite_open_aux_file() API. (CVS 646)
FossilOrigin-Name: 332164d6455658ca633a1dc49811d9fb0fd4b01c
2002-06-25 19:31:18 +00:00
drh
2150432e7c Enhance the INTEGRITY_CHECK pragma to test the auxiliary database file in
addition to the main database file. (CVS 642)

FossilOrigin-Name: 52eba4de301121f254174b74042015bf6069ef11
2002-06-25 13:16:02 +00:00
drh
e0bc4048a0 Added support for the "sqlite_temp_master" table. Increased the version
number to 2.5.2. (CVS 640)

FossilOrigin-Name: 9c1432bf7485258e485bd652e3acdaeabbfe8850
2002-06-25 01:09:11 +00:00
drh
f46f905a1e An optimization: avoid the use of an intermediate table on UNION ALL if there
is no ORDER BY clause. (CVS 637)

FossilOrigin-Name: 8aa73ce61268a50d353d9a5c878461290195525f
2002-06-22 02:33:38 +00:00
drh
d11d382c99 Fix for bugs #77 and #80: Rework the LIMIT mechanism to be reentrant and to
clean up the VDBE stack properly. (CVS 636)

FossilOrigin-Name: 9d5523107937e3700c76666fb058694babdd672c
2002-06-21 23:01:49 +00:00
drh
c926afbc2d Fix for ticket #73: The ORDER BY clause is significant for subqueries.
This passes all regression tests, but more testing is needed to exercise
all paths through the new code. (CVS 631)

FossilOrigin-Name: 43c5aff5d078bce9292683cd40311e0dcc81ac14
2002-06-20 03:38:26 +00:00
drh
27a32783ab Fix for ticket #75: Autoincrement INTEGER PRIMARY KEY fields on an INSERT
even if the data is coming from a SELECT statement. (CVS 630)

FossilOrigin-Name: d599f75b659809a6e5eee09b0e9e6e90bde5af1e
2002-06-19 20:32:43 +00:00
drh
e31847449e The query optimizer now attempts to satisfy an ORDER BY clause using
an index.  Sorting is still used if there are no suitable indices. (CVS 628)

FossilOrigin-Name: f09e19b43ef61073713cf32282c90ea666229eba
2002-06-19 14:27:05 +00:00
chw
b22f1b58ac Added printf-4.(2-4) test cases to test new %Q format specifier. (CVS 622)
FossilOrigin-Name: 7d5fc35b5d38230230344b4f70763f75940ab908
2002-06-16 04:56:36 +00:00
drh
df199a25bd Make the LIMIT clause work even if the destination of the SELECT is
something other than a callback.  (Ticket #66) (CVS 619)

FossilOrigin-Name: 699cf362083043615eb88635a228bfa46a315c9c
2002-06-14 22:38:41 +00:00
danielk1977
6f34903e85 Add RAISE() function, which allows more advanced flow-control in trigger programs (ticket #55) (CVS 614)
FossilOrigin-Name: d4a2fb10067203a0d49317db747759872e62927e
2002-06-11 02:25:40 +00:00
drh
48185c15c7 Added tests for the new IN operator optimizer and fixed a bug that the
new tests found.  This completes the implementation of enhancement #63. (CVS 612)

FossilOrigin-Name: 2a710e18176c486525f0abb06644a511a2cd1d7a
2002-06-09 01:55:20 +00:00
drh
d9e3093038 Fix for ticket #65: If an integer value is too big to be represented as a
32-bit integer, then treat it as a string. (CVS 611)

FossilOrigin-Name: ad9624798edbd6d0c4652fed3d74fe87498844ff
2002-06-09 01:16:01 +00:00
drh
f5db2d3ea2 Bug fix: do not segfault if a SELECT without a FROM clause includes
the * wildcard in the result column list. (CVS 609)

FossilOrigin-Name: d939294994e5f6c7862b66573301e111e56a2681
2002-06-06 23:42:27 +00:00
drh
5df72a5ad6 Fix for ticket #62: Do not report an SQLITE_READONLY error until the application
actually tries to write data into a readonly file.  It is OK to start a
transaction on a read-only file, and doing so will get you a read lock.  This
change allows TEMP tables to be read/write even though the main database is
readonly. (CVS 607)

FossilOrigin-Name: 9ef795d1d756a404d2123ebc19df1985b19c9888
2002-06-06 23:16:05 +00:00
drh
04738cb9ff Add the ability to parse FOREIGN KEYs. Foreign keys are still ignored,
but at least they now do not cause a syntax error. (CVS 603)

FossilOrigin-Name: 6fdcee3c99e994ef3ab83a0cc57344cdb16210df
2002-06-02 18:19:00 +00:00
drh
e4de1feb3e Enhance the ORDER BY clause so that an integer term means to sort by the
corresponding column. (CVS 602)

FossilOrigin-Name: 7acbf84b492202d8b5a05276a95b475027eb5f58
2002-06-02 16:09:01 +00:00
drh
1288c9561d Multiplying NULL by zero gives NULL, not zero. I misread the test data
and coded it wrong.  This check-in fixes the problem. (CVS 601)

FossilOrigin-Name: df9cc852ad02dbec5558d3915a0303f7e7b79b2b
2002-06-01 21:41:10 +00:00
drh
f570f011eb Refinements to NULL processing: NULLs are indistinct for DISTINCT and UNION.
Multiplying a NULL by zero yields zero. In a CASE expression, a NULL comparison
is considered false, not NULL.  With these changes, NULLs in SQLite now work
the same as in PostgreSQL and in Oracle. (CVS 600)

FossilOrigin-Name: da61aa1d238539dff9c43fd9f464d311e28d669f
2002-05-31 15:51:25 +00:00
drh
0f89253e21 Once it is opened, leave the checkpoint journal file open for the
duration of a transaction, rather than closing it and reopening it
for each statement.  (Ticket #53) (CVS 599)

FossilOrigin-Name: 7a24336d50e72006b2cc0e4feb292b946e79d5f3
2002-05-30 12:27:03 +00:00
drh
461c281a2e Bug fix: bad code was generated for when the first operand of a CASE
was NULL. (CVS 598)

FossilOrigin-Name: 4debc8db929fdc201759ba211acdeadc4e30e8af
2002-05-30 02:35:11 +00:00
drh
739105c72c Built-in aggregate functions (MIN, SUM, AVG, etc) should ignore NULL entires. (CVS 597)
FossilOrigin-Name: 19ae12bef210ae5fe171f10833faa38d640c129f
2002-05-29 23:22:23 +00:00
danielk1977
993b173e55 Update trigger2.test to match checkin 591. Also fix ticket #51 (by documenting problem) (CVS 595)
FossilOrigin-Name: 5e74d0964b8fd99eda798e3737217aa499cc1726
2002-05-28 06:55:27 +00:00
drh
c754fa5486 Fix the "alias.*" bug found by Bernie Cosell and reported on the newsgroup. (CVS 593)
FossilOrigin-Name: f562d542304c0c1b18b0cee78b1ecc353327a02e
2002-05-27 03:25:51 +00:00
drh
bb113518f9 Bug fixes and additional test cases for the distinct-NULL patch. (CVS 592)
FossilOrigin-Name: 0e268d0c0faa02c3f95e1567cf631b7a04bfbdf0
2002-05-27 01:04:51 +00:00
danielk1977
d702fccbce Require the INSTEAD OF syntax to create triggers on database views. (CVS 591)
FossilOrigin-Name: d9e48cd5180e2aae7672b9d54e18c37d0fe5258a
2002-05-26 23:24:40 +00:00
drh
f5905aa7be NULL values are distinct. A comparison involving a NULL is always false.
Operations on a NULL value yield a NULL result.  This change makes SQLite
operate more like the SQL spec, but it may break existing applications that
assumed the old behavior.  All the old tests pass but we still need to add
new tests to better verify the new behavior.  Fix for ticket #44. (CVS 589)

FossilOrigin-Name: 9051173742f1b0e15a809d12a0c9c98fd2c4614d
2002-05-26 20:54:33 +00:00
drh
195e6967fb Additional testing of LEFT OUTER JOIN. (CVS 588)
FossilOrigin-Name: d8d04c14f18d1feba89ccea0be70530a18248c51
2002-05-25 00:18:20 +00:00
drh
ad2d8307ac Initial implementation of LEFT OUTER JOIN including the expanded SQL92 join
syntax. The basic functionality is there but there is still a lot of testing
to do. (CVS 587)

FossilOrigin-Name: 99bd1f5b9a1a20bfeefe15c00d96a34a5f40923e
2002-05-24 20:31:36 +00:00
drh
01f3f25376 Add support for the full SQL join syntax. This is just a parser enhancement.
We now recognize all kinds of joins, but we don't actually do anything with
them yet. (CVS 586)

FossilOrigin-Name: e238643efdbe1394c7ff85e34e486f7c6082b6cc
2002-05-24 16:14:15 +00:00
drh
2e392e2c53 Added tests for multi-column primary keys. (CVS 585)
FossilOrigin-Name: ffc49e56b13096b35e6cbb1a2f7d546843d4a91d
2002-05-24 02:14:50 +00:00
drh
07d6e3a74c Partial fix for ticket #49. The correct result is computed, but now we have
a memory leak.  I'm not sure if the memory leak was pre-existing or a result
of this change. (CVS 581)

FossilOrigin-Name: 4d27ee411902a197cd72416ca9da9197d3f87f13
2002-05-23 12:50:18 +00:00
drh
e4697f5e90 Fix some places where a malloc() failure would lead to a segfault. (CVS 580)
FossilOrigin-Name: 01ad352c3c82a86d9c94010cbc85d098b8fbc08a
2002-05-23 02:09:03 +00:00
drh
1873cd508a Do not allow triggers on the SQLITE_MASTER table. (CVS 579)
FossilOrigin-Name: 275ba356f351abcf9a079ac16b765c9443750f0e
2002-05-23 00:30:31 +00:00
drh
97fc3d060a Fix for ticket #46: Report an error if a CREATE TABLE contains two or more
columns with the same name. (CVS 578)

FossilOrigin-Name: ba1953abd04671232cf9e93ab3f962fedbbdc508
2002-05-22 21:27:03 +00:00
drh
2398937b7f Double-quoted strings resolve to column names if possible. Single-quoted
strings continue to be interpreted as string literals. (CVS 576)

FossilOrigin-Name: 55e7d65496624c8e48673d8747f3123786bfedbc
2002-05-21 13:43:04 +00:00
drh
79b0c95687 Fix for ticket #45: Allow an UPDATE statement to change the INTEGER PRIMARY KEY
to itself without triggering a constraint error. (CVS 573)

FossilOrigin-Name: 592da1346872e1373bd13525d05d0f33c1056709
2002-05-21 12:56:43 +00:00
drh
c977f7f596 Additional code cleanup resulting from a review of the new trigger code. (CVS 572)
FossilOrigin-Name: 37dbdd551e88440933066133ec9cc1e10b03fc1a
2002-05-21 11:38:11 +00:00
drh
ce9079c8f2 Fix for ticket #41: Better handling of CREATE TRIGGER in the sqlite_complete()
function. (CVS 567)

FossilOrigin-Name: f45c4b767a6b1451787836060235ff7499dea0de
2002-05-15 14:17:44 +00:00
danielk1977
c3f9bad209 Added FOR EACH ROW triggers functionality (CVS 562)
FossilOrigin-Name: 794bf67b6b36fce8854d5daff12f21dbb943240c
2002-05-15 08:30:12 +00:00
drh
4d908a3b43 Update the misuse.test script so that it will work under Windows. Changes
to the speed testing script to support version 2.4.12. (CVS 560)

FossilOrigin-Name: 232b7ef2c8207eb6d2564a641446267d3dec97af
2002-05-10 14:37:30 +00:00
drh
c22bd47d55 Improvements to the SQLITE_MISUSE detection logic. Also added test cases
for this logic, including the new test file "misuse.test". (CVS 559)

FossilOrigin-Name: f42907ce457e012592f8c043dc6c915e87258b35
2002-05-10 13:14:07 +00:00