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.
This commit is contained in:
User 2025-08-13 23:28:10 +08:00
parent 2ecb9c2aa7
commit 68ebb7d0aa
3 changed files with 4 additions and 1 deletions

View File

@ -108,6 +108,7 @@ class FORK(object):
YUGABYTEDB = "YugabyteDB" YUGABYTEDB = "YugabyteDB"
OPENGAUSS = "OpenGauss" OPENGAUSS = "OpenGauss"
DM8 = "DM8" DM8 = "DM8"
DORIS = "Doris"
class CUSTOM_LOGGING(object): class CUSTOM_LOGGING(object):
PAYLOAD = 9 PAYLOAD = 9

View File

@ -295,7 +295,7 @@ VIRTUOSO_SYSTEM_DBS = ("",)
# Note: (<regular>) + (<forks>) # Note: (<regular>) + (<forks>)
MSSQL_ALIASES = ("microsoft sql server", "mssqlserver", "mssql", "ms") 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") PGSQL_ALIASES = ("postgresql", "postgres", "pgsql", "psql", "pg") + ("cockroach", "cockroachdb", "amazon redshift", "redshift", "greenplum", "yellowbrick", "enterprisedb", "yugabyte", "yugabytedb", "opengauss")
ORACLE_ALIASES = ("oracle", "orcl", "ora", "or") ORACLE_ALIASES = ("oracle", "orcl", "ora", "or")
SQLITE_ALIASES = ("sqlite", "sqlite3") SQLITE_ALIASES = ("sqlite", "sqlite3")

View File

@ -105,6 +105,8 @@ class Fingerprint(GenericFingerprint):
fork = FORK.PERCONA fork = FORK.PERCONA
elif inject.checkBooleanExpression("AURORA_VERSION() LIKE '%'"): # Reference: https://aws.amazon.com/premiumsupport/knowledge-center/aurora-version-number/ elif inject.checkBooleanExpression("AURORA_VERSION() LIKE '%'"): # Reference: https://aws.amazon.com/premiumsupport/knowledge-center/aurora-version-number/
fork = FORK.AURORA fork = FORK.AURORA
elif inject.checkBooleanExpression("BITMAP_UNION_COUNT(NULL) IS NULL"): # Reference: Apache Doris specific BITMAP functions
fork = FORK.DORIS
else: else:
fork = "" fork = ""