mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #1390 from proller/fix6
Fix: An Error SQL will make server down (#1388)
This commit is contained in:
commit
6555d08782
@ -403,7 +403,7 @@ Field DataTypeArray::getDefault() const
|
||||
|
||||
static DataTypePtr create(const ASTPtr & arguments)
|
||||
{
|
||||
if (arguments->children.size() != 1)
|
||||
if (!arguments || arguments->children.size() != 1)
|
||||
throw Exception("Array data type family must have exactly one argument - type of elements", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
||||
|
||||
DataTypePtr nested_type = DataTypeFactory::instance().get(arguments->children[0]);
|
||||
|
@ -0,0 +1 @@
|
||||
Still alive
|
9
dbms/tests/queries/0_stateless/00507_array_no_params.sh
Executable file
9
dbms/tests/queries/0_stateless/00507_array_no_params.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS test.foo;"
|
||||
# Missing arguments for array, table not created
|
||||
$CLICKHOUSE_CLIENT -q "CREATE TABLE test.foo (a Array) Engine=Memory;"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT 'Still alive';"
|
Loading…
Reference in New Issue
Block a user