2015-04-11 03:10:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/Parsers/IParser.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2016-08-17 05:38:51 +00:00
|
|
|
/// Parse query or set 'out_error_message'.
|
2015-04-11 04:15:14 +00:00
|
|
|
ASTPtr tryParseQuery(
|
|
|
|
IParser & parser,
|
2016-08-17 05:38:51 +00:00
|
|
|
IParser::Pos & pos, /// Moved to end of parsed fragment.
|
2015-04-11 04:15:14 +00:00
|
|
|
IParser::Pos end,
|
|
|
|
std::string & out_error_message,
|
|
|
|
bool hilite,
|
2016-08-17 05:38:51 +00:00
|
|
|
const std::string & description,
|
|
|
|
bool allow_multi_statements); /// If false, check for non-space characters after semicolon and set error message if any.
|
2015-04-11 04:15:14 +00:00
|
|
|
|
2015-04-11 03:10:23 +00:00
|
|
|
|
2016-08-17 05:38:51 +00:00
|
|
|
/// Parse query or throw an exception with error message.
|
2015-04-14 20:46:34 +00:00
|
|
|
ASTPtr parseQueryAndMovePosition(
|
|
|
|
IParser & parser,
|
2016-08-17 05:38:51 +00:00
|
|
|
IParser::Pos & pos, /// Moved to end of parsed fragment.
|
2015-04-14 20:46:34 +00:00
|
|
|
IParser::Pos end,
|
2016-08-17 05:38:51 +00:00
|
|
|
const std::string & description,
|
|
|
|
bool allow_multi_statements);
|
2015-04-14 20:46:34 +00:00
|
|
|
|
|
|
|
|
2015-04-11 04:15:14 +00:00
|
|
|
ASTPtr parseQuery(
|
|
|
|
IParser & parser,
|
|
|
|
IParser::Pos begin,
|
|
|
|
IParser::Pos end,
|
|
|
|
const std::string & description);
|
2015-04-11 03:10:23 +00:00
|
|
|
|
2016-10-24 18:18:43 +00:00
|
|
|
|
2016-11-11 17:01:02 +00:00
|
|
|
/** Split queries separated by ; on to list of single queries
|
|
|
|
* Returns pointer to the end of last sucessfuly parsed query (first), and true if all queries are sucessfuly parsed (second)
|
|
|
|
* NOTE: INSERT's data should be placed in single line.
|
|
|
|
*/
|
2016-10-25 12:14:27 +00:00
|
|
|
std::pair<const char *, bool> splitMultipartQuery(const std::string & queries, std::vector<std::string> & queries_list);
|
2016-10-24 18:18:43 +00:00
|
|
|
|
2015-04-11 03:10:23 +00:00
|
|
|
}
|