mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-08 11:40:33 -07:00
Fix issue with mysqldb silently failing to update out of range variables
This commit is contained in:
parent
09c528dd06
commit
ad55918eaf
1 changed files with 14 additions and 3 deletions
|
@ -141,7 +141,7 @@
|
||||||
- name: set mysql variable value to an expression
|
- name: set mysql variable value to an expression
|
||||||
mysql_variables:
|
mysql_variables:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
variable: max_tmp_tables
|
variable: max_connect_errors
|
||||||
value: "1024*4"
|
value: "1024*4"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
@ -151,15 +151,22 @@
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Verify mysql_variable fails when setting an incorrect value (out of range)
|
# Verify mysql_variable fails when setting an incorrect value (out of range)
|
||||||
#
|
#
|
||||||
|
- shell: pip show pymysql | awk '/Version/ {print $2}'
|
||||||
|
register: pymysql_version
|
||||||
|
|
||||||
- name: set mysql variable value to a number out of range
|
- name: set mysql variable value to a number out of range
|
||||||
mysql_variables:
|
mysql_variables:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
variable: max_tmp_tables
|
variable: max_connect_errors
|
||||||
value: -1
|
value: -1
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
- include: assert_var.yml changed=true output={{ result }} var_name=max_connect_errors var_value=1
|
||||||
|
when: pymysql_version.stdout == ""
|
||||||
|
|
||||||
- include: assert_fail_msg.yml output={{ result }} msg='Truncated incorrect'
|
- include: assert_fail_msg.yml output={{ result }} msg='Truncated incorrect'
|
||||||
|
when: pymysql_version.stdout != ""
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Verify mysql_variable fails when setting an incorrect value (incorrect type)
|
# Verify mysql_variable fails when setting an incorrect value (incorrect type)
|
||||||
|
@ -167,12 +174,16 @@
|
||||||
- name: set mysql variable value to a non-valid value number
|
- name: set mysql variable value to a non-valid value number
|
||||||
mysql_variables:
|
mysql_variables:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
variable: max_tmp_tables
|
variable: max_connect_errors
|
||||||
value: TEST
|
value: TEST
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
- include: assert_var.yml changed=true output={{ result }} var_name=max_connect_errors var_value=1
|
||||||
|
when: pymysql_version.stdout == ""
|
||||||
|
|
||||||
- include: assert_fail_msg.yml output={{ result }} msg='Incorrect argument type to variable'
|
- include: assert_fail_msg.yml output={{ result }} msg='Incorrect argument type to variable'
|
||||||
|
when: pymysql_version.stdout != ""
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Verify mysql_variable fails when setting an unknown variable
|
# Verify mysql_variable fails when setting an unknown variable
|
||||||
|
|
Loading…
Add table
Reference in a new issue