Skip to content

Commit

Permalink
functions: Fix tx isolation detection
Browse files Browse the repository at this point in the history
Fixes: #550
  • Loading branch information
jcormier committed Mar 28, 2024
1 parent f3dc70d commit 6ab357c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions assets/runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,13 @@ redmine_check_mysql_database_tx_isolation() {
--user "${DB_USER}" --default-character-set "${DB_ENCODING}" \
--skip-column-names \
--silent "
isolation_lvl=$( MYSQL_PWD="${DB_PASS}" $mysql_cmd \
if ! isolation_lvl=$( MYSQL_PWD="${DB_PASS}" $mysql_cmd \
--execute="SELECT @@GLOBAL.tx_isolation;" )

if [[ $? -ne 0 ]]; then
then
# try the new name of the variable, mysql 8+
isolation_lvl=$( MYSQL_PWD="${DB_PASS}" $mysql_cmd \
if ! isolation_lvl=$( MYSQL_PWD="${DB_PASS}" $mysql_cmd \
--execute="SELECT @@GLOBAL.transaction_isolation;" )

if [[ $? -ne 0 ]]; then
then
echo
echo "ERROR: Failed to check transaction isolation level" >&2
return 1
Expand Down

0 comments on commit 6ab357c

Please sign in to comment.