From 68ebb7d0aa1456fc242ccf5f97d329604e9097fc Mon Sep 17 00:00:00 2001 From: User Date: Wed, 13 Aug 2025 23:28:10 +0800 Subject: [PATCH] Add support for Apache Doris database detection - Add 'doris' to MYSQL_ALIASES in lib/core/settings.py - Add DORIS fork enum in lib/core/enums.py - Add Doris detection logic using BITMAP_UNION_COUNT() function in MySQL fingerprint - Apache Doris will now be properly identified as "MySQL (Doris fork)" instead of showing "MySQL version not found" error Apache Doris is highly compatible with MySQL syntax and protocol but has unique features like BITMAP functions that can be used for detection. --- lib/core/enums.py | 1 + lib/core/settings.py | 2 +- plugins/dbms/mysql/fingerprint.py | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/core/enums.py b/lib/core/enums.py index e1013594e..6e5f65c1e 100644 --- a/lib/core/enums.py +++ b/lib/core/enums.py @@ -108,6 +108,7 @@ class FORK(object): YUGABYTEDB = "YugabyteDB" OPENGAUSS = "OpenGauss" DM8 = "DM8" + DORIS = "Doris" class CUSTOM_LOGGING(object): PAYLOAD = 9 diff --git a/lib/core/settings.py b/lib/core/settings.py index 5bce0b320..1367e4d44 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -295,7 +295,7 @@ VIRTUOSO_SYSTEM_DBS = ("",) # Note: () + () MSSQL_ALIASES = ("microsoft sql server", "mssqlserver", "mssql", "ms") -MYSQL_ALIASES = ("mysql", "my") + ("mariadb", "maria", "memsql", "tidb", "percona", "drizzle") +MYSQL_ALIASES = ("mysql", "my") + ("mariadb", "maria", "memsql", "tidb", "percona", "drizzle", "doris") PGSQL_ALIASES = ("postgresql", "postgres", "pgsql", "psql", "pg") + ("cockroach", "cockroachdb", "amazon redshift", "redshift", "greenplum", "yellowbrick", "enterprisedb", "yugabyte", "yugabytedb", "opengauss") ORACLE_ALIASES = ("oracle", "orcl", "ora", "or") SQLITE_ALIASES = ("sqlite", "sqlite3") diff --git a/plugins/dbms/mysql/fingerprint.py b/plugins/dbms/mysql/fingerprint.py index 0785d9eb2..b61a47666 100644 --- a/plugins/dbms/mysql/fingerprint.py +++ b/plugins/dbms/mysql/fingerprint.py @@ -105,6 +105,8 @@ class Fingerprint(GenericFingerprint): fork = FORK.PERCONA elif inject.checkBooleanExpression("AURORA_VERSION() LIKE '%'"): # Reference: https://aws.amazon.com/premiumsupport/knowledge-center/aurora-version-number/ fork = FORK.AURORA + elif inject.checkBooleanExpression("BITMAP_UNION_COUNT(NULL) IS NULL"): # Reference: Apache Doris specific BITMAP functions + fork = FORK.DORIS else: fork = ""