mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
dbms: addition to prev. revision [#METR-15934].
This commit is contained in:
parent
aa726b203d
commit
d09991bd87
@ -17,6 +17,7 @@
|
||||
#include <DB/DataTypes/DataTypesNumberFixed.h>
|
||||
|
||||
#include <DB/Parsers/ParserSelectQuery.h>
|
||||
#include <DB/Parsers/parseQuery.h>
|
||||
#include <DB/Interpreters/ExpressionAnalyzer.h>
|
||||
|
||||
|
||||
@ -31,21 +32,10 @@ int main(int argc, char ** argv)
|
||||
{
|
||||
size_t n = argc == 2 ? parse<UInt64>(argv[1]) : 10ULL;
|
||||
|
||||
ParserSelectQuery parser;
|
||||
ASTPtr ast;
|
||||
std::string input = "SELECT number, number / 3, number * number";
|
||||
Expected expected = "";
|
||||
|
||||
const char * begin = input.data();
|
||||
const char * end = begin + input.size();
|
||||
const char * pos = begin;
|
||||
|
||||
if (!parser.parse(pos, end, ast, max_parsed_pos, expected))
|
||||
{
|
||||
std::cout << "Failed at position " << (pos - begin) << ": "
|
||||
<< mysqlxx::quote << input.substr(pos - begin, 10)
|
||||
<< ", expected " << expected << "." << std::endl;
|
||||
}
|
||||
ParserSelectQuery parser;
|
||||
ASTPtr ast = parseQuery(parser, input.data(), input.data() + input.size(), "");
|
||||
|
||||
Context context;
|
||||
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
|
||||
|
Loading…
Reference in New Issue
Block a user