mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 04:12:19 +00:00
Fix nullpointer dereference in AddDefaultDatabaseVisitor
This commit is contained in:
parent
7bc6b8fd70
commit
f31c35de48
@ -138,7 +138,12 @@ private:
|
|||||||
/// XXX: for some unknown reason this place assumes that argument can't be an alias,
|
/// XXX: for some unknown reason this place assumes that argument can't be an alias,
|
||||||
/// like in the similar code in `MarkTableIdentifierVisitor`.
|
/// like in the similar code in `MarkTableIdentifierVisitor`.
|
||||||
if (auto * identifier = child->children[i]->as<ASTIdentifier>())
|
if (auto * identifier = child->children[i]->as<ASTIdentifier>())
|
||||||
child->children[i] = identifier->createTable();
|
{
|
||||||
|
/// If identifier is broken then can do nothing and get an exception
|
||||||
|
auto maybe_table_identifier = identifier->createTable();
|
||||||
|
if (maybe_table_identifier)
|
||||||
|
child->children[i] = maybe_table_identifier;
|
||||||
|
}
|
||||||
|
|
||||||
/// Second argument of the "in" function (or similar) may be a table name or a subselect.
|
/// Second argument of the "in" function (or similar) may be a table name or a subselect.
|
||||||
/// Rewrite the table name or descend into subselect.
|
/// Rewrite the table name or descend into subselect.
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
1
|
13
tests/queries/0_stateless/02041_test_fuzzy_alter.sql
Normal file
13
tests/queries/0_stateless/02041_test_fuzzy_alter.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
DROP TABLE IF EXISTS alter_table;
|
||||||
|
|
||||||
|
CREATE TABLE alter_table (a UInt8, b Int16)
|
||||||
|
ENGINE = MergeTree
|
||||||
|
ORDER BY a;
|
||||||
|
|
||||||
|
ALTER TABLE alter_table
|
||||||
|
MODIFY COLUMN `b` DateTime DEFAULT now(([NULL, NULL, NULL, [-2147483648], [NULL, NULL, NULL, NULL, NULL, NULL, NULL]] AND (1048576 AND NULL) AND (NULL AND 1048575 AND NULL AND -2147483649) AND NULL) IN (test_01103.t1_distr.id)); --{serverError 47}
|
||||||
|
|
||||||
|
SELECT 1;
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS alter_table;
|
Loading…
Reference in New Issue
Block a user