2023-04-10 00:31:49 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Tags: no-fasttest
|
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CURDIR"/../shell_config.sh
|
2023-04-10 01:31:43 +00:00
|
|
|
|
2023-04-10 00:31:49 +00:00
|
|
|
|
2023-09-11 09:32:41 +00:00
|
|
|
$CLICKHOUSE_LOCAL --multiquery <<END
|
2023-04-10 00:31:49 +00:00
|
|
|
SELECT * FROM format(JSONEachRow, 'x Bool', '{"x": 1}');
|
|
|
|
SELECT * FROM format(JSONEachRow, 'x Bool', '{"x": null}');
|
|
|
|
END
|
|
|
|
|
2023-09-11 09:32:41 +00:00
|
|
|
$CLICKHOUSE_LOCAL --multiquery <<END 2>&1 | rg -Fc "'w' character"
|
2023-04-10 00:31:49 +00:00
|
|
|
SELECT * FROM format(JSONEachRow, 'x Bool', '{"x": wtf}');
|
|
|
|
END
|
|
|
|
|
2023-09-11 09:32:41 +00:00
|
|
|
$CLICKHOUSE_LOCAL --multiquery <<END 2>&1 | rg -Fc "expected 'false'"
|
2023-04-10 00:31:49 +00:00
|
|
|
SELECT * FROM format(JSONEachRow, 'x Bool', '{"x": ftw}');
|
|
|
|
END
|
|
|
|
|
2023-09-11 09:32:41 +00:00
|
|
|
$CLICKHOUSE_LOCAL --multiquery <<END 2>&1 | rg -Fc "'{' character"
|
2023-04-10 00:31:49 +00:00
|
|
|
SELECT * FROM format(JSONEachRow, 'x Bool', '{"x": {}}');
|
|
|
|
END
|