From 4c627aadd3654eb277bc5c18e860597a303b1bbf Mon Sep 17 00:00:00 2001 From: Yarik Briukhovetskyi <114298166+yariks5s@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:26:10 +0100 Subject: [PATCH] Update 03167_improvement_table_name_too_long.sh --- .../0_stateless/03167_improvement_table_name_too_long.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/queries/0_stateless/03167_improvement_table_name_too_long.sh b/tests/queries/0_stateless/03167_improvement_table_name_too_long.sh index dd8d938d265..1e2f784c4d4 100755 --- a/tests/queries/0_stateless/03167_improvement_table_name_too_long.sh +++ b/tests/queries/0_stateless/03167_improvement_table_name_too_long.sh @@ -4,9 +4,8 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh . "$CUR_DIR"/../shell_config.sh -max_name_length=$($CLICKHOUSE_CLIENT -mn --query="SELECT getMaxTableNameLengthForDatabase('$CLICKHOUSE_DATABASE')") -let allowed_name_length=max_name_length-5 # We substract 5 from the name length because when we create files in the test environment, they have the 'test_' prefix -let excess_length=allowed_name_length+1 +allowed_name_length=$(( $($CLICKHOUSE_CLIENT -mn --query="SELECT getMaxTableNameLengthForDatabase('$CLICKHOUSE_DATABASE')") - 5 )) # Reserve 5 characters for 'test_' prefix +excess_length=$((allowed_name_length + 1)) # Ensure exceeding the limit long_table_name=$(openssl rand -base64 $excess_length | tr -dc A-Za-z | head -c $excess_length) allowed_table_name=$(openssl rand -base64 $allowed_name_length | tr -dc A-Za-z | head -c $allowed_name_length)