mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
Update 03167_improvement_table_name_too_long.sh
This commit is contained in:
parent
f0b706ffde
commit
4c627aadd3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user