You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the mysql_query plugin, we catch the warnings returned by MySQL/MariaDB when we try to recreate or re-delete a resource. This code worked only for PyMySQL. Mysqlclient never supported that feature. In PyMySQL 0.10.1, so for us between the 0.9.3 and 1.0.2 we supports, this stopped working.
Then now, the only way to get green when the query changes nothing is by using an old version of PyMySQL.
The integration tests are filled with tests for connectors version. This only attest that we acknowledge there is many behavior possible, but the end user of the collection will still need to be careful about what connector and what version is in use.
I'm wondering if we can't replace the code responsible to catch the warning from the connector by a simple query SHOW WARNINGS. If it works, we can have both simpler tests and users happy with consistent returned values.
SUMMARY
In the mysql_query plugin, we catch the warnings returned by MySQL/MariaDB when we try to recreate or re-delete a resource. This code worked only for PyMySQL. Mysqlclient never supported that feature. In PyMySQL 0.10.1, so for us between the 0.9.3 and 1.0.2 we supports, this stopped working.
Then now, the only way to get green when the query changes nothing is by using an old version of PyMySQL.
The integration tests are filled with tests for connectors version. This only attest that we acknowledge there is many behavior possible, but the end user of the collection will still need to be careful about what connector and what version is in use.
I'm wondering if we can't replace the code responsible to catch the warning from the connector by a simple query
SHOW WARNINGS
. If it works, we can have both simpler tests and users happy with consistent returned values.The part of the code responsible for this is here: https://github.com/ansible-collections/community.mysql/blob/main/plugins/modules/mysql_query.py#L219-L226
ISSUE TYPE
COMPONENT NAME
mysql_query
COLLECTION VERSION
The text was updated successfully, but these errors were encountered: