mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 19:45:11 +00:00
support show table
This commit is contained in:
parent
0503ed6fb8
commit
f87782b6b5
@ -118,7 +118,7 @@ namespace ErrorCodes
|
||||
extern const int NUMBER_OF_COLUMNS_DOESNT_MATCH;
|
||||
}
|
||||
|
||||
/** Query analyzer implementation overview. Please check documentation in QueryAnalysisPass.h before.
|
||||
/** Query analyzer implementation overview. Please check documentation in QueryAnalysisPass.h first.
|
||||
* And additional documentation for each method, where special cases are described in detail.
|
||||
*
|
||||
* Each node in query must be resolved. For each query tree node resolved state is specific.
|
||||
@ -159,7 +159,7 @@ namespace ErrorCodes
|
||||
*
|
||||
* TODO: This does not supported properly before, because matchers could not be resolved from aliases.
|
||||
*
|
||||
* Identifiers are resolved with following resules:
|
||||
* Identifiers are resolved with following rules:
|
||||
* Resolution starts with current scope.
|
||||
* 1. Try to resolve identifier from expression scope arguments. Lambda expression arguments are greatest priority.
|
||||
* 2. Try to resolve identifier from aliases.
|
||||
|
@ -61,8 +61,9 @@ bool ParserTablePropertiesQuery::parseImpl(Pos & pos, ASTPtr & node, Expected &
|
||||
}
|
||||
else if (s_show.ignore(pos, expected))
|
||||
{
|
||||
auto old_expected = expected;
|
||||
if (!s_create.ignore(pos, expected))
|
||||
return false;
|
||||
expected = old_expected;
|
||||
|
||||
if (s_database.ignore(pos, expected))
|
||||
{
|
||||
|
2
tests/queries/0_stateless/02710_show_table.reference
Normal file
2
tests/queries/0_stateless/02710_show_table.reference
Normal file
@ -0,0 +1,2 @@
|
||||
CREATE TABLE default.t_2710_show_table\n(\n `n1` UInt32,\n `s` String\n)\nENGINE = MergeTree\nORDER BY n1\nSETTINGS index_granularity = 8192
|
||||
CREATE DATABASE t_2710_db\nENGINE = Atomic
|
12
tests/queries/0_stateless/02710_show_table.sql
Normal file
12
tests/queries/0_stateless/02710_show_table.sql
Normal file
@ -0,0 +1,12 @@
|
||||
DROP TABLE IF EXISTS t_2710_show_table;
|
||||
|
||||
CREATE TABLE t_2710_show_table(n1 UInt32, s String) engine=MergeTree order by n1;
|
||||
SHOW TABLE t_2710_show_table;
|
||||
|
||||
DROP TABLE t_2710_show_table;
|
||||
|
||||
DROP DATABASE IF EXISTS t_2710_db;
|
||||
CREATE DATABASE t_2710_db engine=Atomic;
|
||||
SHOW DATABASE t_2710_db;
|
||||
|
||||
DROP DATABASE t_2710_db;
|
Loading…
Reference in New Issue
Block a user