add a test

This commit is contained in:
Bharat Nallan Chakravarthy 2023-11-28 21:26:34 -08:00
parent 4ca3d0d5c4
commit 2c86b251de
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,6 @@
OK
OK
OK
OK
OK
OK

View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
$CLICKHOUSE_CLIENT -q "DROP DATABASE IF EXISTS test_02931;"
$CLICKHOUSE_CLIENT -q "CREATE DATABASE test_02931;"
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_02931.query_log;" 2>&1 | grep -q "Table test_02931.query_log does not exist" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_02931.query_log;" 2>&1 | grep -q " Maybe you meant system.query_log?" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_02931.foo_bar;" 2>&1 | grep -q "Table test_02931.foo_bar does not exist" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_02931.foo_bar;" 2>&1 | grep " Maybe you meant system.foo_bar?" && echo 'FAIL' || echo 'OK'
$CLICKHOUSE_CLIENT -q "SELECT * FROM system.querylog;" 2>&1 | grep -q " Maybe you meant system.query_log?" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -q "SELECT * FROM querylog;" 2>&1 | grep -q " Maybe you meant system.query_log?" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -q "DROP DATABASE test_02931;"