Add CockroachDB error-based fingerprints (PostgreSQL fork)#6067
Open
potato-20 wants to merge 1 commit into
Open
Add CockroachDB error-based fingerprints (PostgreSQL fork)#6067potato-20 wants to merge 1 commit into
potato-20 wants to merge 1 commit into
Conversation
CockroachDB is already recognized as a PostgreSQL fork by the active
fingerprint, but data/xml/errors.xml had no passive (error-message)
signatures for it, so error-based detection couldn't flag a CockroachDB
backend the way it does for the existing MySQL forks (MariaDB/TiDB/MemSQL).
Add two CockroachDB-specific error signatures under the PostgreSQL block:
- the location-first syntax error ('at or near "...": syntax error',
distinct from PostgreSQL's 'syntax error at or near ...')
- the go.crdb.dev / github.com/cockroachdb reference link emitted in
CockroachDB error hints
Validated against CockroachDB v26.2 (Docker): htmlParser() resolves these
to PostgreSQL with forkNote='CockroachDB', while genuine PostgreSQL/MySQL
errors and unrelated pages are unaffected (no false attribution). Each
signature carries a CockroachDB-specific token to avoid false positives.
sha256sums.txt regenerated; smoke test passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CockroachDB is already handled as a PostgreSQL fork by the active fingerprint (
VERSION() LIKE '%CockroachDB%'), butdata/xml/errors.xmlhad no passive (error-message) signatures for it — so error-based detection couldnʼt flag a CockroachDB backend the way it already does for the MySQL forks (MariaDB / TiDB / MemSQL).This adds two CockroachDB-specific signatures under the existing
<dbms value="PostgreSQL">block:at or near "x": syntax error), which is distinct from PostgreSQLʼs verb-firstsyntax error at or near "x".go.crdb.dev/github.com/cockroachdblink CockroachDB emits in error hints.Validation (CockroachDB v26.2, Docker)
Ran the real DB and fed its errors through
htmlParser():So CockroachDB now resolves to the PostgreSQL family annotated as the CockroachDB fork, with no false attribution for real PostgreSQL/MySQL or unrelated pages. Each signature carries a CockroachDB-specific token to keep false positives near zero.
data/txt/sha256sums.txtregenerated for the modified file;--smokepasses.(Follows the existing fork-signature pattern and the precedent of recent DBMS-detection additions like Snowflake #5980.)