fix: map MatrixOne connection SQLSTATEs - #22
Merged
Conversation
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.
Problem
MatrixOne ODBC reports generic
HY000for two connection failures that have standard ODBC SQLSTATEs:28000(invalid authorization specification);3D000(invalid catalog name).This makes pyodbc and other ODBC clients unable to reliably distinguish authentication/configuration failures from generic driver errors.
Tested with MatrixOne
maincommitc6b2ac9c1eaff0db867e845723a8ce1d2102928f, matrixone-odbc basebcc10fec25e5cbc7f1febb70f280c0d94bcac2c3, Windows 11 x64, and pyodbc 5.3.0.Root cause
20101and text containingthere is no userfor an unknown username. The connection path did not pass server error text totranslate_error, so the driver could not classify it.1049isER_BAD_DB_ERROR, but the mapping only handledER_NO_DB_ERROR(1046).Fix
translate_error.28000without treating every MatrixOne20101internal error as authentication failure.ER_BAD_DB_ERRORto3D000alongsideER_NO_DB_ERROR.Minimal reproduction
Regression coverage
mo_odbc_deepnow uses a shared connection-failure helper and asserts:08001(existing behavior remains covered);28000;3D000.Before / after
Test scope
RelWithDebInfobuild: Unicode driver, ANSI driver, andmo_odbc_deepall PASS compilation.28000: PASS3D000: PASSNo Power BI scenario or Power BI-owned driver registration was modified.