mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-22 02:11:27 -07:00
Fix assertion for older mysqlclient than 2.0.1 with mysql (mariadb ok)
This commit is contained in:
parent
0e5f87e969
commit
db72c7948b
1 changed files with 12 additions and 5 deletions
|
@ -368,19 +368,26 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
when:
|
when:
|
||||||
- connector_name == 'pymysql'
|
- connector_name == 'pymysql'
|
||||||
or (connector_name == 'mysqlclient' and connector_ver is version('2.0.1', '>'))
|
or db_engine == 'mariadb'
|
||||||
|
or (
|
||||||
|
db_engine == 'mysql'
|
||||||
|
and connector_name == 'mysqlclient'
|
||||||
|
and connector_ver is version('2.0.1', '>')
|
||||||
|
)
|
||||||
|
|
||||||
# Issue https://github.com/ansible-collections/community.mysql/issues/268
|
# Issue https://github.com/ansible-collections/community.mysql/issues/268
|
||||||
- name: Assert that create table IF NOT EXISTS is changed with mysqlclient <=2.0.1
|
- name: "Assert that create table IF NOT EXISTS is changed with mysqlclient \
|
||||||
|
2.0.1 and mysql"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
# Before mysqlclient 2.0.3, driver throws nothing, so it's impossible to
|
# Mysqlclient 2.0.1, driver throws nothing with mysql, so it's
|
||||||
# figure out if the state was changed or not.
|
# impossible to figure out if the state was changed or not.
|
||||||
# We assume that it was for DDL queries by default in the code
|
# We assume that it was for DDL queries by default in the code
|
||||||
- result is changed
|
- result is changed
|
||||||
when:
|
when:
|
||||||
- connector_name == 'mysqlclient'
|
- connector_name == 'mysqlclient'
|
||||||
- connector_ver is version('2.0.1', '<=')
|
- connector_ver is version('2.0.1', '==')
|
||||||
|
- db_engine == 'mysql'
|
||||||
|
|
||||||
- name: Drop db {{ test_db }}
|
- name: Drop db {{ test_db }}
|
||||||
mysql_query:
|
mysql_query:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue