1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00
Commit Graph

19141 Commits

Author SHA1 Message Date
drh
8912d106e1 Change functions to handle NULLs correctly. Added the NULLIF() function. (CVS 590)
FossilOrigin-Name: 46ce1a9ab6e527958ebc757fa2175c488299cd84
2002-05-26 21:34:58 +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
ad3cab52fe Split the IdList structure into IdList and SrcList. SrcList is used to
represent a FROM clause and IdList is used for everything else.  This change
allows SrcList to grow to support outer joins without burdening the other
uses of IdList. (CVS 584)

FossilOrigin-Name: a167b71d8c27e870bc3079c6132e483bffc83298
2002-05-24 02:04:32 +00:00
drh
bd5a451d5d Change the names of the PushList and PopList opcodes to ListPush and ListPop
so that they will appear together with the other List opcodes in the
documentation. (CVS 583)

FossilOrigin-Name: c53b0b9283c5c34def87d58b03fd979d03dc0890
2002-05-23 22:07:02 +00:00
drh
0b4efed236 Fix for ticket #50. (CVS 582)
FossilOrigin-Name: 82b74a494ac7c751a13e67dcfa7fffb1b98ec808
2002-05-23 13:15:37 +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
2ce1a6ec60 Fix for ticket #47: Use a cast to avoid a warning about discarding a "const"
inside of hash.c. (CVS 577)

FossilOrigin-Name: 0c903461533fabca7815e8cccbd3b712bcd22ddc
2002-05-21 23:44:30 +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
1d1f30555d Clean up some compiler warnings. (CVS 575)
FossilOrigin-Name: 3399b01219b9e75b93587b5634d199d9e6fb6e42
2002-05-21 13:18:25 +00:00
drh
b05789ff2b Modify the shell so that when it is doing a ".dump" it always uses single
quotes and not double quotes for quoting literal strings.  This is for
portability to other databases that only support single quote string literals. (CVS 574)

FossilOrigin-Name: f795afd63f19ab61c2b3b96621cb6dda31ce0379
2002-05-21 13:02:24 +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
danielk1977
f29ce55958 Style fixes to triggers code in various *.c files (partial fix to ticket #39) (CVS 571)
FossilOrigin-Name: 8a4195c7466962291a296e8f53034ea8cb25005f
2002-05-19 23:43:12 +00:00
danielk1977
633ed08d95 Stylistic changes to src/trigger.c (partial fix to ticket #39). Also more comments. (CVS 570)
FossilOrigin-Name: b1d72cb5847a9f5f08e40b36ad117b5493232ea7
2002-05-17 00:05:58 +00:00
danielk1977
d99bc930f7 Fix for ticket #42: Added comments to structs Trigger, TriggerStep and TriggerStack. (CVS 569)
FossilOrigin-Name: 9ec8a2b139ce38312284d7b4eb61221b1e1e3052
2002-05-16 00:13:12 +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
drh
dc3794561f Beginning to clean up the trigger code. Still lots of work to do. (CVS 566)
FossilOrigin-Name: b10346818b25940c6dc85e94de8e36d20954161c
2002-05-15 12:45:43 +00:00
drh
9adf9ac4e4 Remove all tabs from the beginning of source code lines. Replace tabs with
the appropriate number of spaces. (CVS 565)

FossilOrigin-Name: 690f9a163173c4c7af7e8e92e942cee4184c7974
2002-05-15 11:44:13 +00:00
danielk1977
c3f9bad209 Added FOR EACH ROW triggers functionality (CVS 562)
FossilOrigin-Name: 794bf67b6b36fce8854d5daff12f21dbb943240c
2002-05-15 08:30:12 +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
drh
247be43d60 Attempt to detect when two or more threads try to use the same database at
the same time and return an SQLITE_MISUSE error.  Also return this error
if an attempt is made to use a closed database. (CVS 558)

FossilOrigin-Name: a05fabd2df1cb38c555a7b2f31b0ca687db500c2
2002-05-10 05:44:55 +00:00
drh
d5feede1ff Fix for ticket #35: Ignore any ORDER BY clause on a subquery in a FROM clause. (CVS 557)
FossilOrigin-Name: 1b0ee944c9af10078aba628e85d79f8682afa2b6
2002-05-08 21:46:14 +00:00
drh
0f18b450ad Fix for ticket #34: VIEWs ignore their ORDER BY clause. (CVS 556)
FossilOrigin-Name: 5f22d21571acedbd6348b61445a7c408cde8d229
2002-05-08 21:30:15 +00:00
drh
0bb28106be Fix for tickets #32 and #33: Generate the names of the result set early, before
doing the flattening optimization or evaluating subqueries.  Otherwise, the
result set column names are generated incorrectly or after they are needed. (CVS 553)

FossilOrigin-Name: 08f27cb36805d38648274b6fe91dec43a5910057
2002-05-08 11:54:14 +00:00
drh
08192d5f76 Fix for ticket #31: Do not attempt the flattening optimization if the
subselect does not contain a FROM clause.  Handle the special case where
a WHERE clause is constant. (CVS 548)

FossilOrigin-Name: 24e4cf73d22bb41d26bf3c833f1854a9c90923e8
2002-04-30 19:20:28 +00:00
drh
f7bd5d75db Update the test logic and the comments on the encoder.c module. (CVS 546)
FossilOrigin-Name: 18c28519d973944756694b2c213bfef3153f4b1b
2002-04-25 23:06:47 +00:00
drh
e8a49c12a6 Added the "encode.c" source file that contains two utility subroutines that
can be used to encode binary data for use in INSERT and UPDATE statements.
This is just an initial checking.  The code has not yet been integrated into
the library. (CVS 545)

FossilOrigin-Name: 57f7c59713299b03b10ba9c1a5883e2c08a8b138
2002-04-25 11:45:41 +00:00
drh
41202ccae2 Fix for ticket #22: In the code generator for compound SELECT statements, take
care not to generate column name headers if the output is an intermediate table.
Otherwise the column headers are not generated correctly if a compound SELECT
statement appears as an expression in part of the WHERE clause. (CVS 543)

FossilOrigin-Name: a06d9acdd5af0dc69b3a4d024de082631254aead
2002-04-23 17:10:18 +00:00
drh
e98d4fafe4 Fix for ticket #21 (I think): Do not return an "out of memory" error if we
can not find the users home directory. Instead, just report that we could
not find the home directory. (CVS 540)

FossilOrigin-Name: 8a50c57cc3342de9c6eca6c2567d3aa42b407f10
2002-04-21 19:06:22 +00:00
drh
0ac6589202 Fix for ticket #1: Implement the GLOB and LIKE operators as functions that
can be overridden.  This way, a developer can change the LIKE operator to
be case sensitive, for example. (CVS 537)

FossilOrigin-Name: 51572bf71774d7631c7083be90b806e621bc9bee
2002-04-20 14:24:41 +00:00
drh
67505e78c6 Add support for saving the sqlite shell command-line history across sessions. (CVS 536)
FossilOrigin-Name: ca4abf3fe1f0e66802f9f98a20e0c8b82a6459aa
2002-04-19 12:34:06 +00:00
persicom
c8cacb3704 Added rights release for Matthew O. Persico (CVS 535)
FossilOrigin-Name: 6c32c07e8218caffebd4503e7d8a90226ac81cdc
2002-04-19 01:00:12 +00:00
drh
dd45df8a5b Change shell.c so that it will compile under windows. Shorten the help
command somewhat.  Add the state of ".header" to the output of ".show". (CVS 534)

FossilOrigin-Name: 0582168b8b853559b484f4a024d28c67192160c4
2002-04-18 12:39:03 +00:00
persicom
1d0b872d43 Mistake in help text. Spurious trailing whitespace removed. (CVS 532)
FossilOrigin-Name: 4bdd040e4810565c91bcbb5f065580520c5e3c45
2002-04-18 02:53:04 +00:00
persicom
7e2dfdd726 General:
o Added global static chars mainPrompt and continuePrompt.
o Moved Argv0 declaration to head of file. Needed in do_meta_command,
  previously found below that.
o Added struct previous_mode_data to support new .explain toggle
  functionality.
o Added nullvalue, explainPrev and outfile members to
  struct callback_data.
o Added modeDescr array for number/text translation ofdisplay modes.
o Modified zHelp to match new functionality.

callback():
o Added support for .nullvalue

do_meta_command():
o Output filename is now saved to callback struct. If using stdout,
  then the string "stdout" is saved.
o Explain is now a toggle. When it is turned on, the current values of
  mode, header and colWidth are saved if not already in explain mode.
  When turned off, those values are restored.
o Allow .mode plurals columns and lines and dot command plural
  .headers.
o Added processing for new keywords .quit, .nullvalue, .show, .prompt.

main():
o Added -init as an option to override .sqliterc.
o Added -nullvalue as a command line option.
o Processes .sqliterc.

main_init():
o Genesis. Moved some initialization code here from inside main() so
  that it can be called initially by main and again if -init is
  specified.

one_input_line():
o Now takes prompts from settable values.

process_sqliterc():
o Genesis. Read .sqliterc from user's home directory and pass it to
  process_input(). File should contain meta commands for setups. (CVS 531)

FossilOrigin-Name: e751338c468cdad79efcc5cd5b924eb2c1eb3c3a
2002-04-18 02:46:52 +00:00
drh
a168045f7d Fix for ticket #19: Do not call sqliteOsSync() if the only changes were
changes to TEMP tables. (CVS 530)

FossilOrigin-Name: 33da20b9c1a8eef16ad7ab5929bb8937c75090f2
2002-04-18 01:56:57 +00:00
drh
fc6cdfe9dc When doing a ".dump" command in the command-line shell, make sure VIEWs
are created after TABLEs. (CVS 529)

FossilOrigin-Name: 7edd13468e24d79939f0fa1e58f3b686422ca826
2002-04-13 23:42:24 +00:00
drh
c8d30ac109 Fix for bug #15: Add the sqlite_changes() API function for retrieving the
number of rows that changed in the previous operation. (CVS 526)

FossilOrigin-Name: 6e71493b9dc77d508c3ce90562766789e87e6d80
2002-04-12 10:08:59 +00:00
drh
b04a5d8768 Fix for bug #16: Check for invalid functions in the VALUES clause of an
INSERT statement. (CVS 525)

FossilOrigin-Name: 43a77f019d34e1a6b3f502ad0ec31a00c8fdbe6e
2002-04-12 03:55:15 +00:00
drh
feeb1394ee Fix for bug #11: Output the correct row count when and INSERT does an
IGNORE action. (CVS 524)

FossilOrigin-Name: bb83642e9a6c1c9ade861618496933c9f922a8f8
2002-04-09 03:28:01 +00:00
drh
fe1a1773a8 Fix for bug #10: Pop the stack by the right amount on an IGNORE so that the
stack does not grow without bound. (CVS 523)

FossilOrigin-Name: f46acfc3b828620e4e97b09f9aff119b9313e5d7
2002-04-09 03:15:06 +00:00
drh
8b32e17d26 Add a -column option to the sqlite command-line utility.
Patch from Matthew O. Persico. (CVS 522)

FossilOrigin-Name: 760bf568c882d7b28746b1e004309ef08d2ff4c0
2002-04-08 02:42:57 +00:00
drh
6ed41ad735 Added the last_insert_rowid() SQL function. (CVS 521)
FossilOrigin-Name: 6aca3f86bc08849e9d806fdd490f98e4daf71025
2002-04-06 14:10:47 +00:00
drh
bf3a4fa4cb Make the FROM clause on a SELECT optional. If omitted, the result of
the SELECT is a single row consisting of the values in the expression list. (CVS 520)

FossilOrigin-Name: 28ce42f7872e2660faa22e66b508db9b1f046af0
2002-04-06 13:57:42 +00:00