Commit Graph

73 Commits

Author SHA1 Message Date
drh
1e24dc987a Small performance improvement and size reduction by recognizing that no
SQL keywords have less than 2 characters.

FossilOrigin-Name: 6b3d25b7982623ab4b25161aff9ab44778e136069043ab425543597c42c98ae5
2023-06-19 20:54:49 +00:00
drh
9e0181fcf7 Faster implementation of keywordCode() - the routine that determines if an
identifier is really a keyword and if so, which keyword.

FossilOrigin-Name: 0ff3d3d53709b7f18bf01ded1f988e41b7f8471072cf4f2702a3a8b79964be3f
2023-04-08 16:51:08 +00:00
drh
1076130a5d Fix harmless static analyzer warnings in auxiliary build tools, mkkeywordhash.c
and lemon.c.  No changes to the SQLite core.

FossilOrigin-Name: f2f279b2cc1c8b3b162058c33956be4037cd519715ac0c4290f10c58d2528f0a
2021-10-04 16:14:51 +00:00
dan
37f3ac8faa Change things so that SQLITE_OMIT_VIRTUALTABLE implies SQLITE_OMIT_ALTER_TABLE.
FossilOrigin-Name: 2f7c946c5f25a858167f5193ca06e53310394c8cff15426ab8a1327a1ec835fd
2021-10-01 20:39:50 +00:00
drh
745912efac Add the AS MATERIALIZED and AS NOT MATERIALIZED syntax that works like it
does in PostgreSQL.

FossilOrigin-Name: a6bb272ec0c758ab069bfc07443624e0ea7910b1f23224ee078d050fa3ccf068
2021-02-22 03:04:25 +00:00
drh
2053f313bf Lexer and grammar rules for a RETURNING clause on DELETE/INSERT/UPDATE.
Actually making this work, though, will involve a lot more code which will
likely slow down processing for the common case where there is no
RETURNING clause.  Furthermore, RETURNING seems to be of limited usefulness
and it is not standard SQL.  So we abandon it here.  These experimental
changes are parked in a branch as an historical reference.  If circumstances
changes, we might take up the cause again some day.

FossilOrigin-Name: abf8da815646055df5b871d54b99994c1470182dee7952fc5fd627e4379406cb
2021-01-12 20:16:31 +00:00
drh
bb497fe36d Parameterize the hash function in mkkeywordhash.c. This was an attempt to
find a better hash function, which turned out to not be successful.

FossilOrigin-Name: 2195d731f51a18f917c4299d8f4c7ee7c139c2527f62869d6da171a6d1d89ea6
2020-12-02 02:58:05 +00:00
drh
0de19cac43 Unroll the comparison loop inside keywordCode() for to avoid unnecessary
comparisions and thus help that routine run faster.

FossilOrigin-Name: cec5f920f5c2a963f88329a08a443fc04be2dd6f7f2d840be63c0ab1de898f0a
2020-02-06 15:38:43 +00:00
drh
e7d9814fe4 Fix a potential array bounds overflow in the mkkeywordhash.c code generator.
Also add marks to omit keywords specific to generated columns when building
with -DSQLITE_OMIT_GENERATED_COLUMNS.

FossilOrigin-Name: cc6a40818387f78f89499f09e3f1c4655c7396af1cba2596c7fb2f23f3e9755f
2019-11-01 10:49:15 +00:00
drh
bd0f0eb037 Slightly faster keyword hash table.
FossilOrigin-Name: f12e743e19a04ecbf7eb69b675082f2e4dda05b38cd81f6588a1ce95dfc57ada
2019-11-01 02:30:54 +00:00
drh
81f7b37270 Initial experimental code for generated column support. Non-functional.
FossilOrigin-Name: 11d472c1df707b8d03ec57d8fc582a34f5eb89a9d02a154a9871650c65065b45
2019-10-16 12:18:59 +00:00
dan
6e11892db8 Experimental implementation of NULLS FIRST/LAST. This branch still has problems - the most significant of which is that ORDER BY clauses with a non-default NULLS FIRST/LAST qualifier can never use an index.
FossilOrigin-Name: 07babb0f897fc8c9cb5b30481899c32fdd743f3f3ca508d8d957826252107dd5
2019-08-12 16:36:38 +00:00
drh
3fda0aaf00 Put the list of keywords in mkkeywordhash.c into alphabetical order.
FossilOrigin-Name: ac98b23b34632fbc654a34a8b3d842ce65603e4c04d89c589b46f4d48a61152d
2019-04-02 13:10:50 +00:00
dan
d35300f9b6 Parse EXCLUDE clauses in window frames. They do not yet work.
FossilOrigin-Name: d03c7533a1e993f1b12392a5193b2127484307b27072236a1255e7a30849a381
2019-03-14 20:53:21 +00:00
dan
6c75b39614 Finish consolidation of window frame code. Add untested support for GROUPS frames.
FossilOrigin-Name: 954bf369935083c188c3b14e77ed89fc5ec4323cc5b0c67e4a2e48fcc278df45
2019-03-08 20:02:52 +00:00
dan
67a9b8eded Omit all window-function related code when building with SQLITE_OMIT_WINDOWFUNC.
FossilOrigin-Name: 5f04b016467342b5a796bf702ed25b621eb86f2961c1e703d276c93f2cb6aa89
2018-06-22 20:51:35 +00:00
dan
e3bf632cc2 Add support for the WINDOW clause.
FossilOrigin-Name: 19c983b511f1c823fdfb051713681b4c779f02fa83b41189afca0a9b8b72048d
2018-06-08 20:58:27 +00:00
dan
86fb6e1738 Start of experimental implementation of SQL window functions. Does not yet
work.

FossilOrigin-Name: 3781e520854808fe02ad3fe77dd11fc917448c58ff1fd79123289dd91937decd
2018-05-16 20:58:07 +00:00
drh
fc0ec3e5e8 Add new interfaces for accessing the list of SQL keywords:
sqlite3_keyword_count(), sqlite3_keyword_name(), sqlite3_keyword_check().

FossilOrigin-Name: 7dd34e3776fed90a49344d54a1b68bb59f7957b5a8a1a367087b7cafb63111c1
2018-04-25 19:02:48 +00:00
drh
0a6259f539 Remove the MySQL upsert syntax. As an optional alias to the insert table
name in order to finish out PostgreSQL upsert syntax emulation.

FossilOrigin-Name: 810d9f63be46c1452718b05e51c519fb64e9fabf2f1813b5e07b1041dbb71880
2018-04-16 13:26:53 +00:00
drh
6cd7d489db Update the upsert parsing so that it accepts conflict-target labels using
the PostgreSQL syntax, and also accepts the MySQL "ON DUPLICATE KEY"
syntax.

FossilOrigin-Name: c48f64d8ae2625a19267b02e4a173a07766934235ad3052cd9d38f5ecbcbfbc3
2018-04-12 15:43:05 +00:00
drh
2c2e844a36 More complete parsing of UPSERT, including UPSERT within a trigger.
The sqlite3Insert() logic to actually perform the UPSERT is not yet
implemented, however.

FossilOrigin-Name: 5cc2a5a315a2f26b392811de45b3dc352873a173c2c6c65f37ce2e5f88a71cd2
2018-04-07 15:04:05 +00:00
drh
a0c3927510 Change the (machine-generated) keywordhash.h file to increase the scope of the
tables used for keyword matching, so that the tables are accessible to
functions other then keywordCode().

FossilOrigin-Name: c5ed5ebdf660501fde7cc8aefaaaeae2a68e5899a64ac93f26684842a235281d
2017-07-06 16:33:14 +00:00
drh
34dcee6544 Add code to get the tokenizer character-class logic working for EBCDIC.
FossilOrigin-Name: 04f7da77c13925c1f1e287f4579bb85518297d81
2016-02-08 19:15:48 +00:00
drh
41aab89b31 Faster keywordCode() implementation by taking advantage of the fact that
the input is always pure ASCII alphabetic and underscore and that the keyword
table is always upper-case.

FossilOrigin-Name: ff406b9701ebe3a01834837f380641c6f0c495bc
2016-02-08 03:23:46 +00:00
mistachkin
81c7811fe7 Fix harmless compiler warning.
FossilOrigin-Name: eea26b6caea37422c9b46a7a3a538b0c9575f392
2015-11-17 19:16:39 +00:00
drh
54bb56d82a Performance enhancement to the tokenizer.
FossilOrigin-Name: 6ea2df86c95c226052f528424e9bee367a2e765a
2015-11-10 03:30:51 +00:00
drh
7ef4d1c403 Fix a compile of harmless static analyzer warnings.
FossilOrigin-Name: 7e287f2055dcd82c92d1711aec97cb6552a354bb
2014-05-31 15:39:53 +00:00
drh
8b4718636c Parse common table expressions. But do not do anything with them (yet).
FossilOrigin-Name: da98b7205eb3d7ec2ddbf8a8e24eee0b2ff499a5
2014-01-11 13:22:17 +00:00
drh
5969da4a2c Simplification of the syntax: Merely append "WITHOUT rowid" to the end of
the table definition.

FossilOrigin-Name: 131cc6e152abe1a2d48e6d8d40d2c2f8dbe723e7
2013-10-21 02:14:45 +00:00
drh
81eba73ebf Experimental changes toward "index only" tables. Add the ability to specify
options on CREATE TABLE statements using the WITH clause modeled after
PostgreSQL and SQL Server.  Only the "omit_rowid" option is currently
recognized and that option is currently a no-op.

FossilOrigin-Name: 0248ec5e6e3797575388f046d8c27f7445fe2a39
2013-10-19 23:31:56 +00:00
drh
3a2d08e599 Fix a harmless compiler warning in the mkkeywordhash.c utility program.
FossilOrigin-Name: 6015200beb3be7ec141ce36de694278e3ba11a02
2012-04-18 10:13:20 +00:00
drh
0e857739c4 Add a new sqlite3_test_control() verb that facilitates testing that all
keywords are shown in the documentation.  (Two keywords were found to
be missing while testing the change.)

FossilOrigin-Name: d3cdc4b12be7f1ed2249ad210482200868956d12
2010-01-02 03:21:35 +00:00
drh
9a5f4d64f3 Force all qsort() calls in mkkeywordhash.c to be stable so that we get
predictable results on different platforms.

FossilOrigin-Name: 3b02df27ab63936226a90098d88535ed19c2b782
2009-11-03 13:08:16 +00:00
dan
75cbd984f7 Fix compilation with OMIT_TRIGGER defined. Ticket [1ff6d29030e9757d052af0f394e56bea96b8b59b|1ff6d29030].
FossilOrigin-Name: fb6ceed388f6d75bdc2ac2f43e5c98da74e2a448
2009-09-21 16:06:03 +00:00
drh
9bb6697ac6 Modify mkkeywordhash.c so that it puts the original text of each token in
a comment beside the "testcase()" macros. (CVS 6736)

FossilOrigin-Name: a7d0817c176832a88788cc973c0aae8dcab57364
2009-06-09 14:27:41 +00:00
drh
565911e912 Make the TO keyword available even if SQLITE_OMIT_ALTERTABLE is defined.
Ticket #3622. (CVS 6223)

FossilOrigin-Name: 3890985ca6750584876596fd0a124f47ee032075
2009-02-01 00:00:45 +00:00
drh
f3d20c04a2 Avoid surplus bytes at the end of the keyword string table.
Add testcase() macros to make sure all keywords are used during
testing. (CVS 6090)

FossilOrigin-Name: 73958060aaf641d93bede3a42851e5b3451f5432
2008-12-31 21:52:40 +00:00
danielk1977
fd7f045225 Add the savepoint feature. This feature is largely untested at this point. (CVS 6036)
FossilOrigin-Name: 34b56600ec0c5cd7b5faab265750252bc9850e3e
2008-12-17 17:30:26 +00:00
shane
00c586a238 Fixed typo in comment in mkkeywordhash.c. (CVS 6009)
FossilOrigin-Name: b7dd05b403e69caca814ccd8824130f176160cd5
2008-12-10 20:11:01 +00:00
drh
1875f7a3db The amalgamation now compiles cleanly on GCC with options
-pedantic-errors -Wno-long-long. (CVS 5991)

FossilOrigin-Name: 73c7302c5f76a2f61ecd75f8bda69bb500d3119c
2008-12-08 18:19:17 +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
rse
43e47c8ec1 Get rid of the following compile-time warnings:
tool/mkkeywordhash.c:353: warning: array subscript has type 'char'
tool/mkkeywordhash.c:354: warning: array subscript has type 'char' (CVS 4189)

FossilOrigin-Name: c01d7944799d8a96a29f8d4f6d2bb7c4bb0e14bb
2007-07-30 18:26:19 +00:00
drh
ca5557f91d Change incremental vacuum to be triggered by a pragma rather than a command.
We have a lot to learn about this yet and we do not want to paint ourselves
into a corner by commiting to specific syntax too early. (CVS 3921)

FossilOrigin-Name: b13e497a326697ab42b429993a1eee7df3c0c3eb
2007-05-04 18:30:40 +00:00
drh
744f2f4658 Tighter compression of the keyword hash table. (CVS 3920)
FossilOrigin-Name: 681216767d7fabfccb0b12f6a81b18b6d1c252bf
2007-05-04 17:07:52 +00:00
danielk1977
dddbcdcc68 Add largely untested code for the incremental vacuum function. (CVS 3876)
FossilOrigin-Name: f6a6d2b8872c05089810b1e095f39011f3035408
2007-04-26 14:42:34 +00:00
drh
60218d2a0e The FOR EACH STATEMENT clause in a trigger is now a syntax error. It used
to be silently ignored.  STATEMENT is no longer a keyword. (CVS 3821)

FossilOrigin-Name: 8e2559b4da6329d7c21925d0850f7f91a3731975
2007-04-06 11:26:00 +00:00
drh
fdbcdee5ff The -DSQLITE_OMIT_ATTACH=1 option now omits both the ATTACH and VACUUM
commands. Ticket #2268.
 The regression test suite depends on both of these commands
and will not run if compiled with this option. (CVS 3727)

FossilOrigin-Name: cbebfb89603044e48b3a87b79d1eefbbc5b4c8a5
2007-03-27 14:44:50 +00:00
drh
0d5359b9d8 Add comments to the top of keywordhash.h. (CVS 3651)
FossilOrigin-Name: 0aa9ed5bbfb756967a6f761c5fc2f274a5466e2d
2007-02-21 16:44:33 +00:00
drh
e09daa90ac Basic parsing of CREATE VIRTUAL TABLE statements. (CVS 3210)
FossilOrigin-Name: 66370cb99bd93abb33e1e8433672da45e1795f78
2006-06-10 13:29:31 +00:00