improve the test file and add fragment files for issue 671

This commit is contained in:
SoledaD208 2024-10-21 22:20:35 +07:00
commit 596743374b
2 changed files with 17 additions and 5 deletions

View file

@ -0,0 +1,12 @@
bugfixes:
- mysql_user,mysql_role - The sql_mode ANSI_QUOTES affects how the modules mysql_user
and mysql_role compare the existing privileges with the configured privileges,
as well as decide whether double quotes or backticks should be used in the GRANT
statements. Pointing out in issue 671, the modules mysql_user and mysql_role allow
users to enable/disable ANSI_QUOTES in session variable (within a DB session, the
session variable always overwrites the global one). But due to the issue, the modules
do not check for ANSI_MODE in the session variable, instead, they only check in the
GLOBAL one.That behavior is not only limiting the users' flexibility, but also not
allowing users to explicitly disable ANSI_MODE to work around such bugs like
https://bugs.mysql.com/bug.php?id=115953.
(https://github.com/ansible-collections/community.mysql/issues/671)

View file

@ -40,6 +40,11 @@
query: 'select @@GLOBAL.sql_mode AS sql_mode'
register: sql_mode_orig
- name: Issue-671| Assert sql_mode_orig
assert:
that:
- sql_mode_orig.query_result[0][0].sql_mode != None
- name: Issue-671| enable sql_mode ANSI_QUOTES
mysql_variables:
<<: *mysql_params
@ -47,11 +52,6 @@
value: '{{ sql_mode_orig.query_result[0][0].sql_mode }},ANSI_QUOTES'
mode: "{% if db_engine == 'mariadb' %}global{% else %}persist{% endif %}"
- name: Issue-671| test setup | get value of GLOBAL.sql_mode
mysql_query:
<<: *mysql_params
query: 'select @@GLOBAL.sql_mode'
- name: Issue-671| Copy SQL scripts to remote
copy:
src: "{{ item }}"