mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-21 18:01:28 -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
|
||||
when:
|
||||
- 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
|
||||
- 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:
|
||||
that:
|
||||
# Before mysqlclient 2.0.3, driver throws nothing, so it's impossible to
|
||||
# figure out if the state was changed or not.
|
||||
# Mysqlclient 2.0.1, driver throws nothing with mysql, 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', '<=')
|
||||
- connector_ver is version('2.0.1', '==')
|
||||
- db_engine == 'mysql'
|
||||
|
||||
- name: Drop db {{ test_db }}
|
||||
mysql_query:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue