From 839736756ae8eb744e5cd11f71b8886e3fc5262f Mon Sep 17 00:00:00 2001
From: Laurent Indermuehle <laurent.indermuehle@pm.me>
Date: Thu, 26 Oct 2023 13:39:55 +0200
Subject: [PATCH] Document MySQL and MariaDB don't store roles with same manner

---
 plugins/module_utils/user.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/plugins/module_utils/user.py b/plugins/module_utils/user.py
index a88b32e..dbc1c9b 100644
--- a/plugins/module_utils/user.py
+++ b/plugins/module_utils/user.py
@@ -743,6 +743,14 @@ def privileges_grant(cursor, user, host, db_table, priv, tls_requires, maria_rol
     priv_string = ",".join([p for p in priv if p not in ('GRANT', )])
     query = ["GRANT %s ON %s" % (priv_string, db_table)]
 
+    # MySQL and MariaDB don't store roles in the user table the same manner:
+    # select user, host from mysql.user;
+    # +------------------+-----------+
+    # | user             | host      |
+    # +------------------+-----------+
+    # | role_foo         | %         | <- MySQL
+    # | role_foo         |           | <- MariaDB
+    # +------------------+-----------+
     if not maria_role:
         query.append("TO %s@%s")
         params = (user, host)