-
Notifications
You must be signed in to change notification settings - Fork 101
Using show all slaves status
when using MariaDB to be consistent with MySQL
#602
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
Changes from 15 commits
a7de8f8
b2072a2
db4c50e
2de02bd
ed93655
6eec740
4c5e8f8
c66a5ac
3ef93e8
10660cf
fff53b4
690ac6f
aa7c5be
4a2a638
d61bb70
93e42bc
6ac515b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- mysql_info - The `slave_status` filter was returning an empty list on MariaDB with multiple replication channels. It now returns all channels by running `SHOW ALL SLAVES STATUS` for MariaDB servers. (https://github.com/ansible-collections/community.mysql/issues/603). | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -207,6 +207,27 @@ def get_server_version(cursor): | |||||||||||||||||||||||||||||
return version_str | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
def get_server_implementation(cursor): | ||||||||||||||||||||||||||||||
if 'mariadb' in get_server_version(cursor).lower(): | ||||||||||||||||||||||||||||||
return "mariadb" | ||||||||||||||||||||||||||||||
else: | ||||||||||||||||||||||||||||||
return "mysql" | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
def is_mariadb(implementation): | ||||||||||||||||||||||||||||||
if implementation == "mariadb": | ||||||||||||||||||||||||||||||
return True | ||||||||||||||||||||||||||||||
else: | ||||||||||||||||||||||||||||||
return False | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
def is_mysql(implementation): | ||||||||||||||||||||||||||||||
if implementation == "mysql": | ||||||||||||||||||||||||||||||
return True | ||||||||||||||||||||||||||||||
else: | ||||||||||||||||||||||||||||||
return False | ||||||||||||||||||||||||||||||
|
def is_mariadb(implementation): | |
if implementation == "mariadb": | |
return True | |
else: | |
return False | |
def is_mysql(implementation): | |
if implementation == "mysql": | |
return True | |
else: | |
return False |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,6 +5,7 @@ | |||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | ||||||
|
||||||
from __future__ import absolute_import, division, print_function | ||||||
|
||||||
__metaclass__ = type | ||||||
|
||||||
DOCUMENTATION = r''' | ||||||
|
@@ -292,6 +293,8 @@ | |||||
mysql_driver_fail_msg, | ||||||
get_connector_name, | ||||||
get_connector_version, | ||||||
get_server_implementation, | ||||||
is_mariadb, | ||||||
|
is_mariadb, |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if is_mariadb(self.server_implementation): | |
if self.server_implementation == "mariadb": |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,9 +1,10 @@ | ||||||||||||||||||||||||||||||||
from __future__ import (absolute_import, division, print_function) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
__metaclass__ = type | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
import pytest | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
from ansible_collections.community.mysql.plugins.module_utils.mysql import get_server_version | ||||||||||||||||||||||||||||||||
from ansible_collections.community.mysql.plugins.module_utils.mysql import get_server_version, get_server_implementation, is_mariadb, is_mysql | ||||||||||||||||||||||||||||||||
|
from ansible_collections.community.mysql.plugins.module_utils.mysql import get_server_version, get_server_implementation, is_mariadb, is_mysql | |
from ansible_collections.community.mysql.plugins.module_utils.mysql import get_server_version, get_server_implementation |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_is_mysql(): | |
""" | |
Test that server is_mysql return expect results | |
""" | |
assert is_mysql("mysql") is True | |
assert is_mysql("mariadb") is False | |
def test_is_mariadb(): | |
""" | |
Test that server is_mariadb return expect results | |
""" | |
assert is_mariadb("mariadb") is True | |
assert is_mariadb("mysql") is False |
Uh oh!
There was an error while loading. Please reload this page.