Commit Graph

82 Commits

Author SHA1 Message Date
javrucebo
66804a6281 Allow '==' to be parsed as equal operator in expressions.
SQLite allows for this and it is in the same spirit as allowing both != and <>
for non equality.
(see https://sqlite.org/lang_expr.html#collateop)
2018-01-22 18:54:52 +01:00
Lawrence
a578842117 Fix order of table_ref 2018-01-17 16:47:57 +01:00
Lawrence
1425deb75d Merge master 2018-01-17 15:53:23 +01:00
Lawrence
77e396703f Add stringLength information to hsql::Statement 2018-01-17 15:43:38 +01:00
Moritz Eyssen
074bce4d90 dix and adapt casecasewhen 2018-01-17 13:11:39 +01:00
javrucebo
daf8fe7a45 Changing Grammar to extend CASE WHEN statement:
- allow multiple WHEN statements
- allow for syntax like `CASE x WHEN 1 THEN 2 WHEN 3 THEN 4 ELSE 5 END`
NOTE: This changes also the way the CASE operator is stored:
- CASE [expr] exprList [ELSE expr2] END
- exprList holds each of the WHEN statements with:
  expr := WHEN, expr2 := THEN

Added also tests in test/select_tests.cpp
and adapted the existing one to reflect the new storage
2018-01-16 00:45:55 +01:00
Moritz Eyssen
0d0ba53546 Formatting and more tests 2017-10-12 19:18:38 +02:00
root
cf28f8fdaf space format 2017-09-29 17:19:39 +08:00
root
d220ff47ab add drop test case in test/queries/queries-good.sql 2017-09-29 17:15:18 +08:00
root
7da22a8bb1 fix %destructor of table_n 2017-09-13 21:59:15 +08:00
root
45cae0bb0b cancel empty from clause support 2017-09-13 18:12:29 +08:00
root
1922210f70 1. add scheme name support for tables names
2. add IF EXIST support for DROP TABLE/VIEW
3. fix memory free bug: delete -> free
4. add features in sqlhelper.cpp
2017-09-13 17:37:31 +08:00
Markus Dreseler
68e4d1b207 Make UPDATE use expression, not literal
This allows for things like UPDATE x SET a = a + 1
2017-09-12 19:50:34 +02:00
Tim Zimmermann
0233f77cef Add support for SHOW TABLES statement 2017-08-23 23:56:16 +02:00
alkim0
88ffe4822b Many updates to grammar including support for arrays, ilike, natural joins with no predicates... (#49)
* Got ISNULL working

* Allow function calls with no arguments

* Added no-else cases and arrays

* Added more operations including ilike, concat

* Added optional all to set operations and fixed natural join

* Ran astyle

* Used the appropriate star expression

Instead of using a ColumnRef with star literal.

* NULL expressions now returns true isLiteral

* Fixed structure for no-else case clauses

* Fixed up grammar conflicts
2017-07-26 19:09:02 +02:00
Tim Zimmermann
6a05b8e94b Add enum types for formerly 'simple' operands (#48)
* Add enum types for formerly 'simple' operands

* Use non-semantic names

* Formatting

* Add generated files
2017-06-29 13:40:24 +02:00
Pedro Flemming
1483a4a95a Add Hints per statement to SQL syntax. 2017-06-06 22:15:19 +02:00
Pedro Flemming
f85a5e7b52 Prepared Statements (#43)
Changed PREPARE syntax to be closer to the standard.
2017-05-29 16:22:13 +02:00
Pedro Flemming
793258f872 Add capability for multi join table references (#40) 2017-04-21 22:03:12 +02:00
Pedro Flemming
0909c6a89a Documentation & Result Move Constructor (#39)
Updates documentation, adds a move constructor to SQLParserResult, fixes compile-time warnings
2017-04-21 16:15:07 +02:00
Pedro Flemming
074c564cc4 move initialization of SQLParserResult to SQLParser from bison_parser 2017-04-07 16:07:14 +02:00
Pedro Flemming
eddd799c26 rename operators to match constant naming style. Move the enum out of Expr 2017-04-06 17:25:47 +02:00
Pedro
39d0dbd9af Implement CREATE VIEW and DROP VIEW 2017-03-08 17:42:33 +01:00
Pedro
a0e55035fd Implement NOT EXISTS 2017-03-07 15:53:22 +01:00
Pedro
177901816f add more join types 2017-03-07 15:49:49 +01:00
Pedro
b4adfa5b74 implement IN operator 2017-03-07 15:44:44 +01:00
Pedro
bf255c65ac fix memory leaks 2017-03-07 15:09:39 +01:00
Pedro
b7828e698e implement CASE WHEN expressions 2017-03-07 14:55:51 +01:00
Pedro
5605dbab7e implement EXISTS conditional 2017-03-07 14:37:19 +01:00
Pedro
cf1c84d46d Add select statement as possible operand in expressions 2017-03-07 14:22:52 +01:00
Pedro
35b8b569eb Implement BETWEEN operator 2017-03-07 13:49:56 +01:00
Pedro
9ecfa8e8f6 Allow function expressions to have variable length of parameters 2017-03-07 02:51:04 +01:00
Pedro
f82504b319 Allow order by to define a list of expressions to order by 2017-03-07 02:30:44 +01:00
Pedro Flemming
42049b4d56 Benchmarking (#27)
Adds benchmarking capabilities and small grammar fix.
2017-03-06 18:30:35 +01:00
Pedro
de56d9a7ea fix error in parser destructor 2017-02-10 21:42:02 +01:00
Pedro
1f183147ec fix memory leaks when parsing fails 2017-02-08 04:56:07 +01:00
Pedro
5041dccf70 fix all leaks triggered by sql_grammar_test.cpp 2017-02-08 04:27:04 +01:00
Pedro
4aca7d035f fixed inconsistend member naming. fixed building of error result in parser 2017-02-08 03:07:51 +01:00
Adnan Hasnain Alam
bcb5fe5e82 Enable compilation on clang++ also
‘uint’ is only available on Linux. Other than this, there seems to be
no other dependency on the compiler.
2016-04-30 10:26:18 +05:30
Pedro
4632abf92d change var names to camelCase 2016-02-27 15:22:22 +01:00
Pedro
57b8cdd31b adjust names of members 2016-02-27 14:45:59 +01:00
Pedro
3df367e668 renamed SQLStatementList to SQLParserResult and moved into separate file 2016-02-27 14:24:23 +01:00
Pedro
5046c6477f restructured source code and build dynamic library 2015-12-23 16:01:08 +01:00
Pedro
2f110b8168 implemented DEALLOCATE PREPARE 2015-01-07 13:42:11 +01:00
Pedro
ab9a85704f modification to prepare syntax 2015-01-07 13:24:39 +01:00
Pedro
0c309ad658 minor doc changes 2015-01-06 20:01:10 +01:00
Pedro
71f9252019 removed List class wrapper and use simply std::vector throughout 2015-01-06 19:47:59 +01:00
Pedro
b5aba646d8 support for execute without parameter list added 2015-01-06 19:20:52 +01:00
Pedro
fed174a892 improved prepared statements 2015-01-06 15:29:18 +01:00
Pedro
57b062f2b0 added distinct 2014-12-18 12:28:24 +01:00