Add filter for issues resolved in newer version of mysqlclient

This commit is contained in:
Laurent Indermuehle 2023-01-17 13:29:03 +01:00
commit 73ee8f07c9
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09

View file

@ -339,22 +339,27 @@
register: result
# Issue https://github.com/ansible-collections/community.mysql/issues/268
- assert:
- name: "Assert that create table IF NOT EXISTS is not changed with pymysql \
and mysqlclient > 2.0.1"
assert:
that:
# PyMySQL driver throws a warning, so the following is correct
- result is not changed
when:
- connector_name == 'pymysql'
or (connector_name == 'mysqlclient' and connector_ver is version('2.0.1', '>'))
# Issue https://github.com/ansible-collections/community.mysql/issues/268
- assert:
- name: Assert that create table IF NOT EXISTS is changed with mysqlclient <=2.0.1
assert:
that:
# mysqlclient driver throws nothing, so it's impossible to figure out
# if the state was changed or not.
# We assume that it was for DDL queryes by default in the code
# Before mysqlclient 2.0.3, driver throws nothing, so it's impossible to
# figure out if the state was changed or not.
# We assume that it was for DDL queries by default in the code
- result is changed
when:
- connector_name == 'mysqlclient'
- connector_ver is version('2.0.1', '<=')
- name: Drop db {{ test_db }}
mysql_query: