mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Add test 03221_create_if_not_exists_setting
This commit is contained in:
parent
2af1134c08
commit
cc0412c553
@ -0,0 +1,4 @@
|
||||
57
|
||||
82
|
||||
0
|
||||
0
|
43
tests/queries/0_stateless/03221_create_if_not_exists_setting.sh
Executable file
43
tests/queries/0_stateless/03221_create_if_not_exists_setting.sh
Executable file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
# $CLICKHOUSE_CLIENT -mn -q "SET create_if_not_exists=0;" # Default
|
||||
$CLICKHOUSE_CLIENT -mn -q "
|
||||
DROP TABLE IF EXISTS example_table;
|
||||
CREATE TABLE example_table (id UInt32) ENGINE=MergeTree() ORDER BY id;
|
||||
CREATE TABLE example_table (id UInt32) ENGINE=MergeTree() ORDER BY id;
|
||||
" 2> /dev/null
|
||||
# ensure failed error code
|
||||
echo $?
|
||||
$CLICKHOUSE_CLIENT -mn -q "
|
||||
DROP DATABASE IF EXISTS example_database;
|
||||
CREATE DATABASE example_database;
|
||||
CREATE DATABASE example_database;
|
||||
" 2> /dev/null
|
||||
echo $?
|
||||
|
||||
$CLICKHOUSE_CLIENT -mn -q "
|
||||
SET create_if_not_exists=1;
|
||||
DROP TABLE IF EXISTS example_table;
|
||||
CREATE TABLE example_table (id UInt32) ENGINE=MergeTree() ORDER BY id;
|
||||
CREATE TABLE example_table (id UInt32) ENGINE=MergeTree() ORDER BY id;
|
||||
"
|
||||
# ensure successful error code
|
||||
echo $?
|
||||
|
||||
|
||||
$CLICKHOUSE_CLIENT -mn -q "
|
||||
SET create_if_not_exists=1;
|
||||
DROP DATABASE IF EXISTS example_database;
|
||||
CREATE DATABASE example_database;
|
||||
CREATE DATABASE example_database;
|
||||
"
|
||||
echo $?
|
||||
|
||||
$CLICKHOUSE_CLIENT -mn -q "
|
||||
DROP DATABASE example_database;
|
||||
DROP TABLE example_table;
|
||||
"
|
Loading…
Reference in New Issue
Block a user