This commit is contained in:
Bharat Nallan Chakravarthy 2023-11-28 23:26:21 -08:00
parent 2c86b251de
commit 56366b7919
2 changed files with 14 additions and 8 deletions

View File

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

View File

@ -6,14 +6,20 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
$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 "DROP TABLE IF EXISTS test_table_02931;"
$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 1 FROM system.numbers LIMIT 1;" 2>&1
$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 "SELECT 1 FROM test_02931.numbers LIMIT 1;" 2>&1 | grep -q -e "Table test_02931.numbers does not exist" -e "Maybe you meant system.numbers?" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_02931.foo_bar;" 2>&1 | grep -q -e "Table test_02931.foo_bar does not exist" -v -e "Maybe you meant system.foo_bar?" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -q "SELECT 1 FROM system.numbers2 LIMIT 1;" 2>&1 | grep -q -e "Maybe you meant system.numbers?" -e "Maybe you meant system.numbers?" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -n --query="CREATE TABLE test_table_02931 (n Int) Engine=MergeTree() ORDER BY n;"
$CLICKHOUSE_CLIENT -n --query="INSERT INTO TABLE test_table_02931 VALUES(1);"
$CLICKHOUSE_CLIENT -n --query="SELECT * FROM test_table_02931 LIMIT 1;"
$CLICKHOUSE_CLIENT -n --query="SELECT * FROM test_02931.test_table_02931 LIMIT 1;" 2>&1 | grep -q -e "Table test_02931.test_table_02931 does not exist" -e "Maybe you meant default.test_table_02931?" && echo 'OK' || echo 'FAIL'
$CLICKHOUSE_CLIENT -q "DROP TABLE test_table_02931;"
$CLICKHOUSE_CLIENT -q "DROP DATABASE test_02931;"