-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ANSI_QUOTES is get from global variable sql_mode instead of session variable. Therefore, it may use the quotes incorrectly if session sql_mode differs from global one #671
Comments
here's my suggested fix, could anyone please have a look? https://github.com/ansible-collections/community.mysql/compare/main...SoledaD208:community.mysql:check_ansi_quotes_in_session_variable?diff=unified&w= |
Hi @SoledaD208, thank you for taking the time to describe the issue. I'm not sure I understand the use case, though. The get_mode() method is used in Regarding your suggested fix: To be "Pull Request worthy," it needs a changelog fragment and integration tests. If you open a PR, we (the maintainers) will gladly help you complete these tasks. |
hi @laurent-indermuehle sorry for replying late. Incorrect getting the sql_mode |
I just created the PR. It would be great if you can help to review and help with the changelog and integration tests. |
Fixed in #677 |
SUMMARY
ANSI_QUOTES is get from global variable sql_mode instead of session variable. Therefore, it may parse the quotes incorrectly if session sql_mode differs from global one
ISSUE TYPE
COMPONENT NAME
mysql_user module
ANSIBLE VERSION
any versions
COLLECTION VERSION
any versions
STEPS TO REPRODUCE
create a client config file and set up sql_mode differs from the global variable then run the module. There will be parse error.
sample client config file:
[client]
username=...
password=...
init-command="set sql_mode='ANSI_QUOTES'" # while global sql_mode does not include ANSI_QUOTES
EXPECTED RESULTS
ANSI_QUOTES in session variable should be detect correctly
The text was updated successfully, but these errors were encountered: