Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add support for Apache Doris database detection#5940

Closed
lesignals wants to merge 4 commits intosqlmapproject:masterfrom
lesignals:add-doris-support
Closed

Add support for Apache Doris database detection#5940
lesignals wants to merge 4 commits intosqlmapproject:masterfrom
lesignals:add-doris-support

Conversation

@lesignals
Copy link
Copy Markdown

  • 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.

- 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.
@stamparm
Copy link
Copy Markdown
Member

image

User and others added 3 commits August 22, 2025 10:47
- Use VERSION() = '5.7.99' as primary Doris fingerprint (more reliable than BITMAP functions)
- Add @@VERSION_COMMENT checks for both Doris and StarRocks
- Add StarRocks fork detection to avoid misidentification
- Remove unreliable BITMAP_UNION_COUNT() as sole detection method

This addresses the issue where BITMAP_UNION_COUNT() alone could misidentify
StarRocks or other bitmap-compatible systems as Doris. The new multi-step
detection logic provides more accurate database identification.
- Use VERSION()='5.7.99' as primary fingerprint (Apache Doris hardcoded value)
- Add dual verification: VERSION()='5.7.99' AND @@VERSION_COMMENT LIKE '%Doris%'
- Prioritize StarRocks detection to avoid confusion
- Provide fallback detection for restricted environments
- Based on official Doris documentation: version() always returns '5.7.99'

This implementation follows best practices:
1. StarRocks checked first (returns real versions like 5.1.0)
2. Combined verification for Apache Doris (5.7.99 + banner)
3. Fallback to version-only detection when VERSION_COMMENT inaccessible
4. Leverages the fact that MySQL never released version 5.7.99
@stamparm
Copy link
Copy Markdown
Member

sorry, looks messed. will refactor and push smth similar

stamparm added a commit that referenced this pull request Aug 24, 2025
@stamparm stamparm closed this Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants