Commit Graph

32 Commits

Author SHA1 Message Date
mrks
a4703fec5b
Add DESCRIBE (#131) 2019-09-16 11:58:05 +02:00
mrks
755ea052d7
Remove HISTORY keyword (#129) 2019-07-31 12:43:18 +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
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
Moritz Eyssen
73ed061d7d Support EXTRACT (#95)
* EXTRACT support

* formatting

* formatting

* formatting
2018-05-23 03:02:14 +02: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
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
Pedro Flemming
128cd74670 fix token generator for negative numbers (#41) 2017-04-25 17:25:00 +02:00
Pedro
b7828e698e implement CASE WHEN expressions 2017-03-07 14:55:51 +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
ab9a85704f modification to prepare syntax 2015-01-07 13:24:39 +01:00
Pedro
98c84abcba added location tracking to parser 2014-12-15 14:43:42 +01:00
Pedro
48b473e7c5 refactored test framework 2014-12-03 16:32:56 +01:00
Pedro
789a4a5b9b added class and keywords for updates 2014-11-26 12:19:33 +01:00
Pedro
b86bf6e7f9 implemented insert statement 2014-11-26 00:26:20 +01:00
Pedro
070ea2de28 added join types and algorithms 2014-11-17 22:13:11 +01:00
Pedro
541a666e32 added if not exists option to create table stmt 2014-11-17 02:18:31 +01:00
Pedro
48dbab8258 minor changes 2014-11-13 17:54:24 +01:00
Pedro
dfbc50ed27 Implemented UNION and OFFSET 2014-11-13 01:27:47 +01:00
Pedro
71cbe1bfac refactored test suite. added alias to expressions 2014-11-12 10:43:10 +01:00
Pedro
8d7d7b65ff changed import tbl to create tbl syntax 2014-11-12 00:11:07 +01:00
Pedro
7d12fb3ec4 added keyword list generator. Now understanding names in double quotes 2014-11-07 16:29:46 +01:00
Pedro
7c30786b53 now parsing ImportStatements 2014-11-07 01:09:06 +01:00
Pedro
34da5535fe added support for comments and like operator 2014-11-05 15:54:41 +01:00
Pedro
afe8dafef5 implemented table alias 2014-11-04 01:42:09 +01:00
Pedro
ff0167cde6 added join definition to grammar. put limit and order tokens into lexer 2014-11-03 23:26:33 +01:00
Pedro
ae44960bad removed obsolete incomplete lemon sql parser code 2014-11-03 23:03:49 +01:00