mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-03 12:44:25 -07:00
improve the test file and add fragment files for issue 671
This commit is contained in:
parent
8ef32e5eff
commit
596743374b
2 changed files with 17 additions and 5 deletions
12
changelogs/fragments/671-modules_util_user.yml
Normal file
12
changelogs/fragments/671-modules_util_user.yml
Normal 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)
|
|
@ -40,6 +40,11 @@
|
||||||
query: 'select @@GLOBAL.sql_mode AS sql_mode'
|
query: 'select @@GLOBAL.sql_mode AS sql_mode'
|
||||||
register: sql_mode_orig
|
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
|
- name: Issue-671| enable sql_mode ANSI_QUOTES
|
||||||
mysql_variables:
|
mysql_variables:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
|
@ -47,11 +52,6 @@
|
||||||
value: '{{ sql_mode_orig.query_result[0][0].sql_mode }},ANSI_QUOTES'
|
value: '{{ sql_mode_orig.query_result[0][0].sql_mode }},ANSI_QUOTES'
|
||||||
mode: "{% if db_engine == 'mariadb' %}global{% else %}persist{% endif %}"
|
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
|
- name: Issue-671| Copy SQL scripts to remote
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue