ClickHouse/tests/queries/0_stateless/02918_sqlite_path_check.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
529 B
Bash
Raw Normal View History

2023-11-20 11:20:26 +00:00
#!/usr/bin/env bash
2023-11-20 15:04:21 +00:00
# Tags: no-fasttest
# Tag no-fasttest: Fast tests don't build external libraries (SQLite)
2023-11-20 11:20:26 +00:00
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');