Commit Graph

232 Commits

Author SHA1 Message Date
Jan Mühlig 46a54548fe Added insert multiple rows 2020-10-22 10:45:03 +02:00
Jan Mühlig c2f5ba9857 Added create index 2020-10-22 09:49:28 +02:00
Markus Dreseler e5eb7a8893 Make clang-11 ready 2020-10-19 15:07:45 +02:00
Ankush Rayabhari b6dfe73051 Fix segfault on printing cast/extract exprs
- Additionally, fix printing logic
2020-09-01 08:25:15 -07:00
Ankush Rayabhari 8d1c86f192 Added support for casting to DATE 2020-08-31 20:42:08 -07:00
Markus Dreseler f7bc462e18 Update flex cpp/h 2020-06-18 12:47:02 +02:00
Markus Dreseler d91debc538 Remove tokens that are defined more than once 2020-06-18 12:46:25 +02:00
Mike Siomkin 7b22ee8ecb Add support of CAST(expression AS datatype(length))
CAST(expression AS datatype(length)) construction is a part of
ANSI SQL-92 standard. So we have to support it.
2020-06-16 22:39:00 +03:00
Mike Siomkin 0f96b977e9 Use awk to check versions
Some Linux distributions (e.g. Centos) don't have bc installed by
default. And some (e.g Centos 8) don't have binary packages for it
available either. It's safer to use awk instead of bc to check
versions of bison and flex in the parser Makefile.

Closes #144
2020-05-24 13:43:01 +03:00
Christian Clauss cd646f9971
Use print() function in both Python 2 and Python 3 (#141)
Thanks!
2020-04-07 23:46:03 +02:00
Tobias Nack e8ce1c4caf
Add support to identify different set operators & allow chain of multiple set operators (#138) 2020-02-18 14:26:10 +01:00
Till Later 4b617bca96 Adds simple transaction commands (#137) 2020-01-14 13:21:19 +01:00
Daniel Lindner e3cfc80975 Add COPY for import and export (#139) 2020-01-08 16:21:02 +01:00
mrks a4703fec5b
Add DESCRIBE (#131) 2019-09-16 11:58:05 +02:00
f4lco 6e730a5436 Print matching token for operator types instead of plain integer (#85)
* Print matching token for operator types instead of plain integer

* Update sqlhelper.cpp
2019-08-13 16:07:19 +02:00
mrks 755ea052d7
Remove HISTORY keyword (#129) 2019-07-31 12:43:18 +02:00
d-justen de4f81bb18 Support Create Table As Syntax (#127)
* support create table as select statement

* Generate bison code

* add test
2019-06-07 11:42:49 +02:00
Julian Menzler 6003ab58d1 Support WITH (#125)
* Add struct WithDescription in SelectStatement.h

* Add test for With statements

* Implement With draft

* tm

* Fix Grammar

* Fix commented code

* naming improvements

* naming improvements

* introduce memory leak1

* removed memory leak

* Create two WITH-tests

* Add bad queries reg. WITH
2019-05-24 16:42:28 +02:00
mrks ab1e6b4192
Fix printing of EXISTS (SELECT) (#114)
* Fix printing of EXISTS (SELECT)

* Update sqlhelper.cpp
2019-04-23 11:35:17 +02:00
mrks ddb6276fac
Fix print (#112) 2019-04-23 11:03:18 +02:00
Leander Neiss e0e58d0876 Allow Expressions in LIMIT and OFFSET. (#111)
* Allow Expressions in LIMIT and OFFSET.

* Make NULL distinguishable from nullptr (not present) for LIMIT and OFFSET.
2019-04-04 12:25:15 +02:00
Moritz Eyssen 9701403ff5 Fix multi-threaded parsing (#110)
This should fix multi-threaded parsing. Not a clean solution, I am guessing the following block should be a single, state-less pattern? @mrks

```
\'                          { BEGIN singlequotedstring; strbuf = std::stringstream{}; }
<singlequotedstring>\'\'    { strbuf << '\''; }
<singlequotedstring>[^']*   { strbuf << yytext; }
<singlequotedstring>\'      { BEGIN 0; yylval->sval = strdup(strbuf.str().c_str()); return SQL_STRING; }
<singlequotedstring><<EOF>> { fprintf(stderr, "[SQL-Lexer-Error] Unterminated string\n"); return 0; }
```

Anyway, the following hyrise playground does not crash anymore, so Toni should be able to work with this for the time being.

```c++
#include <iostream>
#include <thread>

#include "types.hpp"
#include "tpch/tpch_queries.hpp"
#include "SQLParser.h"

using namespace opossum;  // NOLINT

int main() {
  std::vector<std::thread> threads;

  for (size_t t = 0; t < 200; ++t) {
    threads.emplace_back([&]() {
      for (size_t p = 0; p < 10'000; ++p) {
        hsql::SQLParserResult result;
        hsql::SQLParser::parse(tpch_queries.at(19), &result);
        std::cout << "Parsing " << p << " is valid: " << result.isValid() << std::endl;
      }
    });
  }

  for (auto& thread : threads) {
    thread.join();
  }

  return 0;
}
```
2019-03-22 07:07:17 -05:00
mrks 1b86e5e624
Make parameters for execute optional (#107) 2018-11-23 11:10:31 +01:00
mrks bd56ba8f7a
Fix type inconsistency (#106) 2018-11-17 12:10:39 +01:00
mrks b35fce9977
store all float values in doubles (#105) 2018-11-17 12:02:48 +01:00
mrks 62d162579a
Support escaped strings (e.g., 'Max O''Mustermann') (#104)
* Support escaped strings (e.g., 'Max O''Mustermann')

* review
2018-11-12 15:35:31 +01:00
alkim0 a59deb43c3 Added boolean literal support (#103)
* Added boolean support

* Made bool literals int vals

With a flag indicating if they came from boolean literals.

* Add makeLiteral(bool val);
2018-11-02 11:42:23 +01:00
mrks a122effd46
Fix Tokens (#102)
* Fix Tokens

* fix

* ci
2018-10-22 22:05:29 +02:00
mrks f7bd4ee592
Support more of the CREATE TABLE command (#101)
* Support more of the CREATE TABLE command

* bison version

* build on nemea

* bla

* Check for flex version
2018-10-19 14:18:03 +02:00
mrks 79bdad949f
Remove PART keyword (#100)
* Remove PART keyword

* Change it in some tests
2018-10-10 16:33:53 +02:00
mrks c7980a0009
Fix include guard naming [-Wreserved-id-macro] (#99) 2018-09-29 10:38:29 +02:00
Tim Zimmermann 1f564e16b8 Add tests for SUBSTR support (#96)
* Add test for SUBSTR support

* Trigger CI

* Trigger

* Trigger

* Trigger

* Remove CMake file
2018-05-30 17:52:56 +10:00
Moritz Eyssen 73ed061d7d Support EXTRACT (#95)
* EXTRACT support

* formatting

* formatting

* formatting
2018-05-23 03:02:14 +02:00
Moritz Eyssen 82e73f66d2 No FROM required (#94) 2018-05-22 15:35:39 +02:00
Falco Duersch 2ff32fbee3 Extend table alias with column renames: "AS tbl(c0, c1)" 2018-02-12 11:28:36 +01:00
Markus Dreseler 8bd3ad3a2c
Fix use of old flex version 2018-02-08 18:06:17 +01:00
Markus Dreseler 8ec540fc52
Merge branch 'master' of https://github.com/hyrise/sql-parser into limit-offset 2018-02-08 17:25:30 +01:00
Moritz Eyssen c43af4b401
Update bison_parser.y 2018-02-08 16:46:30 +01:00
javrucebo e33e6f61f7 committing bison/flex output to run testsuite on travis 2018-01-27 01:00:55 +01:00
javrucebo cdd271490b Allow more variations of LIMIT/OFFSET
In addtion to already supported LIMIT/OFFSET variants allow more to be parsed

Legacy:
  - LIMIT int
  - LIMIT int OFFSET int

Enhancement:
  - OFFSET int             (no limit)
  - LIMIT ALL              (no limit)
  - LIMIT NULL             (no limit)
  - LIMIT ALL OFFSET int   (no limit, but offset)
  - LIMIT NULL OFFSET int  (no limit, but offset)

Also ensures negative limits / offsets are set to kNoLimit/kNoOffset
2018-01-27 00:33:23 +01:00
Moritz Eyssen 48f32a4b73 remove unused enum members 2018-01-24 15:35:45 +01:00
mrks 5fa5a94c9e
Merge branch 'master' into operator-equals 2018-01-24 14:20:23 +01:00
mrks ac9a742fce
Rearrange order of join types 2018-01-23 13:39:42 +01:00
javrucebo 66688f7199 Adjust Table Join Types
Consolidate LeftOuter/Left and RightOuter/Right as they are
by definition the same.
Similar consolidate FullOuter/Outer/Full ... with Outer (as in the
parser) not part of standard, but "full" missing. Allowing all three.

This commit potentially breaks other programs as kJoinLeftOuter and kJoinRightOuter
are eliminated
2018-01-22 20:44:33 +01:00
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
mrks 314d697fa2
Merge branch 'master' into fix_ref_table_order 2018-01-18 10:13:34 +01:00
Lawrence a578842117 Fix order of table_ref 2018-01-17 16:47:57 +01:00
Lawrence 2f5502cb93
Fix typo 2018-01-17 16:05:42 +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