ClickHouse/src/Parsers/ParserQuery.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
3.8 KiB
C++
Raw Normal View History

#include <Parsers/ParserAlterQuery.h>
#include <Parsers/ParserCreateFunctionQuery.h>
2020-07-06 13:57:45 +00:00
#include <Parsers/ParserCreateQuery.h>
#include <Parsers/ParserCreateIndexQuery.h>
2021-05-14 22:43:04 +00:00
#include <Parsers/ParserDropFunctionQuery.h>
#include <Parsers/ParserDropIndexQuery.h>
#include <Parsers/ParserDropNamedCollectionQuery.h>
#include <Parsers/ParserAlterNamedCollectionQuery.h>
2020-07-06 13:57:45 +00:00
#include <Parsers/ParserDropQuery.h>
#include <Parsers/ParserInsertQuery.h>
#include <Parsers/ParserOptimizeQuery.h>
#include <Parsers/ParserQuery.h>
#include <Parsers/ParserQueryWithOutput.h>
#include <Parsers/ParserRenameQuery.h>
#include <Parsers/ParserSetQuery.h>
#include <Parsers/ParserSystemQuery.h>
#include <Parsers/ParserUseQuery.h>
#include <Parsers/ParserExternalDDLQuery.h>
2021-03-31 17:55:04 +00:00
#include <Parsers/ParserTransactionControl.h>
#include <Parsers/ParserDeleteQuery.h>
2011-10-30 11:30:52 +00:00
#include <Parsers/Access/ParserCreateQuotaQuery.h>
#include <Parsers/Access/ParserCreateRoleQuery.h>
#include <Parsers/Access/ParserCreateRowPolicyQuery.h>
#include <Parsers/Access/ParserCreateSettingsProfileQuery.h>
#include <Parsers/Access/ParserCreateUserQuery.h>
#include <Parsers/Access/ParserDropAccessEntityQuery.h>
#include <Parsers/Access/ParserGrantQuery.h>
#include <Parsers/Access/ParserMoveAccessEntityQuery.h>
#include <Parsers/Access/ParserSetRoleQuery.h>
2011-10-30 11:30:52 +00:00
namespace DB
{
bool ParserQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
2011-10-30 11:30:52 +00:00
{
ParserQueryWithOutput query_with_output_p(end, allow_settings_after_format_in_insert);
ParserInsertQuery insert_p(end, allow_settings_after_format_in_insert);
2012-07-12 19:49:22 +00:00
ParserUseQuery use_p;
2012-08-02 19:03:32 +00:00
ParserSetQuery set_p;
ParserSystemQuery system_p;
ParserCreateUserQuery create_user_p;
ParserCreateRoleQuery create_role_p;
2019-12-01 22:01:05 +00:00
ParserCreateQuotaQuery create_quota_p;
2019-11-29 17:22:56 +00:00
ParserCreateRowPolicyQuery create_row_policy_p;
ParserCreateSettingsProfileQuery create_settings_profile_p;
ParserCreateFunctionQuery create_function_p;
2021-05-14 22:43:04 +00:00
ParserDropFunctionQuery drop_function_p;
2022-11-15 14:49:25 +00:00
ParserCreateNamedCollectionQuery create_named_collection_p;
ParserDropNamedCollectionQuery drop_named_collection_p;
ParserAlterNamedCollectionQuery alter_named_collection_p;
ParserCreateIndexQuery create_index_p;
ParserDropIndexQuery drop_index_p;
2019-12-01 22:01:05 +00:00
ParserDropAccessEntityQuery drop_access_entity_p;
ParserMoveAccessEntityQuery move_access_entity_p;
ParserGrantQuery grant_p;
ParserSetRoleQuery set_role_p;
2020-07-06 13:57:45 +00:00
ParserExternalDDLQuery external_ddl_p;
2021-03-31 17:55:04 +00:00
ParserTransactionControl transaction_control_p;
ParserDeleteQuery delete_p;
bool res = query_with_output_p.parse(pos, node, expected)
|| insert_p.parse(pos, node, expected)
|| use_p.parse(pos, node, expected)
|| set_role_p.parse(pos, node, expected)
|| set_p.parse(pos, node, expected)
2019-12-01 22:01:05 +00:00
|| system_p.parse(pos, node, expected)
|| create_user_p.parse(pos, node, expected)
|| create_role_p.parse(pos, node, expected)
2019-12-01 22:01:05 +00:00
|| create_quota_p.parse(pos, node, expected)
2019-11-29 17:22:56 +00:00
|| create_row_policy_p.parse(pos, node, expected)
|| create_settings_profile_p.parse(pos, node, expected)
|| create_function_p.parse(pos, node, expected)
2021-05-14 22:43:04 +00:00
|| drop_function_p.parse(pos, node, expected)
2022-11-15 14:49:25 +00:00
|| create_named_collection_p.parse(pos, node, expected)
|| drop_named_collection_p.parse(pos, node, expected)
|| alter_named_collection_p.parse(pos, node, expected)
|| create_index_p.parse(pos, node, expected)
|| drop_index_p.parse(pos, node, expected)
|| drop_access_entity_p.parse(pos, node, expected)
|| move_access_entity_p.parse(pos, node, expected)
2020-07-06 13:57:45 +00:00
|| grant_p.parse(pos, node, expected)
2021-03-31 17:55:04 +00:00
|| external_ddl_p.parse(pos, node, expected)
|| transaction_control_p.parse(pos, node, expected)
|| delete_p.parse(pos, node, expected);
2012-07-12 19:49:22 +00:00
return res;
2011-10-30 11:30:52 +00:00
}
2012-07-12 19:49:22 +00:00
}