mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fixed segfault in EXISTS query
This commit is contained in:
parent
8727f30ef8
commit
0998dcbda6
@ -41,6 +41,8 @@ bool ParserTablePropertiesQuery::parseImpl(Pos & pos, ASTPtr & node, Expected &
|
||||
query = std::make_shared<ASTExistsTableQuery>();
|
||||
else if (s_dictionary.checkWithoutMoving(pos, expected))
|
||||
query = std::make_shared<ASTExistsDictionaryQuery>();
|
||||
else
|
||||
query = std::make_shared<ASTExistsTableQuery>();
|
||||
}
|
||||
else if (s_show.ignore(pos, expected))
|
||||
{
|
||||
|
24
dbms/tests/queries/0_stateless/01048_exists_query.reference
Normal file
24
dbms/tests/queries/0_stateless/01048_exists_query.reference
Normal file
@ -0,0 +1,24 @@
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
44
dbms/tests/queries/0_stateless/01048_exists_query.sql
Normal file
44
dbms/tests/queries/0_stateless/01048_exists_query.sql
Normal file
@ -0,0 +1,44 @@
|
||||
EXISTS database_for_dict.t;
|
||||
EXISTS TABLE database_for_dict.t;
|
||||
EXISTS DICTIONARY database_for_dict.t;
|
||||
|
||||
DROP DATABASE IF EXISTS database_for_dict;
|
||||
CREATE DATABASE database_for_dict Engine = Ordinary;
|
||||
|
||||
DROP TABLE IF EXISTS database_for_dict.t;
|
||||
EXISTS database_for_dict.t;
|
||||
EXISTS TABLE database_for_dict.t;
|
||||
EXISTS DICTIONARY database_for_dict.t;
|
||||
|
||||
CREATE TABLE database_for_dict.t (x UInt8) ENGINE = Memory;
|
||||
EXISTS database_for_dict.t;
|
||||
EXISTS TABLE database_for_dict.t;
|
||||
EXISTS DICTIONARY database_for_dict.t;
|
||||
|
||||
DROP TABLE database_for_dict.t;
|
||||
EXISTS database_for_dict.t;
|
||||
EXISTS TABLE database_for_dict.t;
|
||||
EXISTS DICTIONARY database_for_dict.t;
|
||||
|
||||
DROP DICTIONARY IF EXISTS t;
|
||||
CREATE TEMPORARY TABLE t (x UInt8);
|
||||
EXISTS t; -- Does not work for temporary tables. Maybe have to fix.
|
||||
EXISTS TABLE t;
|
||||
EXISTS DICTIONARY t;
|
||||
|
||||
CREATE DICTIONARY database_for_dict.t (k UInt64, v String) PRIMARY KEY k LAYOUT(FLAT()) SOURCE(HTTP(URL 'https://yandex.ru/' FORMAT TSV)) LIFETIME(1000);
|
||||
EXISTS database_for_dict.t;
|
||||
EXISTS TABLE database_for_dict.t; -- Dictionaries are tables as well. But not all tables are dictionaries.
|
||||
EXISTS DICTIONARY database_for_dict.t;
|
||||
|
||||
-- But dictionary-tables cannot be dropped as usual tables.
|
||||
DROP TABLE database_for_dict.t; -- { serverError 60 }
|
||||
DROP DICTIONARY database_for_dict.t;
|
||||
EXISTS database_for_dict.t;
|
||||
EXISTS TABLE database_for_dict.t;
|
||||
EXISTS DICTIONARY database_for_dict.t;
|
||||
|
||||
DROP DATABASE database_for_dict;
|
||||
EXISTS database_for_dict.t;
|
||||
EXISTS TABLE database_for_dict.t;
|
||||
EXISTS DICTIONARY database_for_dict.t;
|
Loading…
Reference in New Issue
Block a user