Complete MariaDB fix on debian 12

fix #598
This commit is contained in:
Antoine Nguyen
2025-09-24 11:22:51 +02:00
parent 212fa9b5c1
commit 355e8d9b98
2 changed files with 8 additions and 10 deletions

View File

@@ -10,8 +10,7 @@ from . import system
from . import utils from . import utils
class Database(object): class Database:
"""Common database backend.""" """Common database backend."""
default_port: Optional[int] = None default_port: Optional[int] = None
@@ -157,7 +156,6 @@ class PostgreSQL(Database):
class MySQL(Database): class MySQL(Database):
"""MySQL backend.""" """MySQL backend."""
default_port = 3306 default_port = 3306
@@ -178,7 +176,7 @@ class MySQL(Database):
if name.startswith("debian"): if name.startswith("debian"):
if version.startswith("8"): if version.startswith("8"):
self.packages["deb"].append("libmysqlclient-dev") self.packages["deb"].append("libmysqlclient-dev")
elif version.startswith("11") or version.startswith("12"): elif int(version[:2]) >= 11:
self.packages["deb"].append("libmariadb-dev") self.packages["deb"].append("libmariadb-dev")
else: else:
self.packages["deb"].append("libmariadbclient-dev") self.packages["deb"].append("libmariadbclient-dev")

View File

@@ -104,21 +104,21 @@ mysql %dbhost {
# #
# Commonly used available substitutions (see https://doc.dovecot.org/latest/core/settings/variables.html # Commonly used available substitutions (see https://doc.dovecot.org/latest/core/settings/variables.html
# for full list): # for full list):
# %{user} = entire user@domain # %%{user} = entire user@domain
# %{user|username} = user part of user@domain # %%{user|username} = user part of user@domain
# %{user|domain} = domain part of user@domain # %%{user|domain} = domain part of user@domain
# #
# Note that these can be used only as input to SQL query. If the query outputs # Note that these can be used only as input to SQL query. If the query outputs
# any of these substitutions, they're not touched. Otherwise it would be # any of these substitutions, they're not touched. Otherwise it would be
# difficult to have eg. usernames containing '%' characters. # difficult to have eg. usernames containing '%%' characters.
# #
# Example: # Example:
# query = SELECT userid AS user, pw AS password \ # query = SELECT userid AS user, pw AS password \
# FROM users WHERE userid = '%u' AND active = 'Y' # FROM users WHERE userid = '%%u' AND active = 'Y'
# #
# query = \ # query = \
# SELECT userid as username, domain, password \ # SELECT userid as username, domain, password \
# FROM users WHERE userid = '%{user|username}' AND domain = '%{user|domain}' # FROM users WHERE userid = '%%{user|username}' AND domain = '%%{user|domain}'
#} #}
passdb sql { passdb sql {