Use sql file to test changes

This commit is contained in:
sfod 2019-09-20 17:39:26 +03:00
parent 0bad4b4a05
commit bf2654e093
3 changed files with 13 additions and 18 deletions

View File

@ -1,3 +1,7 @@
ok 11
ok
ok 11
12
12
13
13

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
EXCEPTION_SUCCESS_TEXT=ok
# Must throw an exception
EXCEPTION_TEXT="WITH TOTALS, ROLLUP or CUBE are not supported without aggregation"
$CLICKHOUSE_CLIENT --query="SELECT 1 AS id, 'hello' AS s WITH TOTALS" 2>&1 \
| grep -q "$EXCEPTION_TEXT" && echo "$EXCEPTION_SUCCESS_TEXT" || echo "Did not throw an exception"
$CLICKHOUSE_CLIENT --query="SELECT 1 AS id, 'hello' AS s WITH ROLLUP" 2>&1 \
| grep -q "$EXCEPTION_TEXT" && echo "$EXCEPTION_SUCCESS_TEXT" || echo "Did not throw an exception"
$CLICKHOUSE_CLIENT --query="SELECT 1 AS id, 'hello' AS s WITH CUBE" 2>&1 \
| grep -q "$EXCEPTION_TEXT" && echo "$EXCEPTION_SUCCESS_TEXT" || echo "Did not throw an exception"

View File

@ -0,0 +1,6 @@
SELECT 11 AS n GROUP BY n WITH TOTALS;
SELECT 12 AS n GROUP BY n WITH ROLLUP;
SELECT 13 AS n GROUP BY n WITH CUBE;
SELECT 1 AS n WITH TOTALS; -- { serverError 49 }
SELECT 1 AS n WITH ROLLUP; -- { serverError 49 }
SELECT 1 AS n WITH CUBE; -- { serverError 49 }