2021-10-17 08:42:36 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-10-17 19:09:17 +00:00
|
|
|
# Tags: no-fasttest, no-parallel
|
2021-10-17 08:42:36 +00:00
|
|
|
|
|
|
|
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CUR_DIR"/../shell_config.sh
|
|
|
|
|
2024-07-09 22:24:53 +00:00
|
|
|
FILE_PATH="${USER_FILES_PATH}/file"
|
2021-10-18 07:29:57 +00:00
|
|
|
mkdir -p ${FILE_PATH}
|
|
|
|
chmod 777 ${FILE_PATH}
|
2021-10-17 08:42:36 +00:00
|
|
|
|
2021-10-18 07:29:57 +00:00
|
|
|
FILE="test_symlink_${CLICKHOUSE_DATABASE}"
|
2021-10-17 08:42:36 +00:00
|
|
|
|
2021-10-18 07:29:57 +00:00
|
|
|
symlink_path=${FILE_PATH}/${FILE}
|
2024-01-04 01:46:03 +00:00
|
|
|
symlink_path_with_regex="${FILE_PATH}*/${FILE}"
|
2021-10-17 08:42:36 +00:00
|
|
|
file_path=$CUR_DIR/${FILE}
|
|
|
|
|
2021-10-17 19:09:17 +00:00
|
|
|
touch ${file_path}
|
|
|
|
ln -s ${file_path} ${symlink_path}
|
2021-10-19 08:27:48 +00:00
|
|
|
chmod ugo+w ${symlink_path}
|
2021-10-17 15:21:43 +00:00
|
|
|
|
2021-10-17 08:42:36 +00:00
|
|
|
function cleanup()
|
|
|
|
{
|
|
|
|
rm ${symlink_path} ${file_path}
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} --query="insert into table function file('${symlink_path}', 'Values', 'a String') select 'OK'";
|
2023-04-08 19:02:18 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --query="select * from file('${symlink_path}', 'Values', 'a String') order by a";
|
2024-01-03 04:57:41 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --query="select * from file('${symlink_path_with_regex}', 'Values', 'a String') order by a";
|