mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Update 03221_create_if_not_exists_setting test to a .sql test
This commit is contained in:
parent
d31c56e0d9
commit
83d20bee00
@ -1,4 +0,0 @@
|
||||
57
|
||||
82
|
||||
0
|
||||
0
|
32
tests/queries/0_stateless/03221_create_if_not_exists_setting.sh → tests/queries/0_stateless/03221_create_if_not_exists_setting.sql
Executable file → Normal file
32
tests/queries/0_stateless/03221_create_if_not_exists_setting.sh → tests/queries/0_stateless/03221_create_if_not_exists_setting.sql
Executable file → Normal file
@ -1,43 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
SET create_if_not_exists=0; -- Default
|
||||
|
||||
# $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 "
|
||||
CREATE TABLE example_table (id UInt32) ENGINE=MergeTree() ORDER BY id; -- { serverError TABLE_ALREADY_EXISTS }
|
||||
|
||||
DROP DATABASE IF EXISTS example_database;
|
||||
CREATE DATABASE example_database;
|
||||
CREATE DATABASE example_database;
|
||||
" 2> /dev/null
|
||||
echo $?
|
||||
CREATE DATABASE example_database; -- { serverError DATABASE_ALREADY_EXISTS }
|
||||
|
||||
$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 IF EXISTS example_database;
|
||||
DROP TABLE IF EXISTS example_table;
|
||||
"
|
||||
DROP TABLE IF EXISTS example_table;
|
Loading…
Reference in New Issue
Block a user