ClickHouse/tests/queries/0_stateless/02918_sqlite_path_check.sh
Raúl Marín ff438112e9 Style
2023-11-20 18:08:39 +01:00

16 lines
530 B
Bash
Executable File

#!/usr/bin/env bash
# Tags: no-fasttest
# Tag no-fasttest: Fast tests don't build external libraries (SQLite)
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
function get_exception_message()
{
$CLICKHOUSE_CLIENT --query "$1" |& head -n1 | sed 's/.*DB::Exception: \(.*\) (version.*/\1/g'
}
get_exception_message "Select * from sqlite('/etc/passwd', 'something');"
get_exception_message "Select * from sqlite('../../../../etc/passwd', 'something');"