You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing table uses parser error 1064 instead of MySQL error 1146, preventing ODBC SQLSTATE 42S02 #26684
MatrixOne ODBC baseline: MySQL Connector/ODBC 9.7.0
Reproduction
mysql --protocol=tcp -h 127.0.0.1 -P 6001 -u root test \
-e "select * from mo_odbc_missing_state"
Observed:
ERROR 1064 (HY000): SQL parser error: table "mo_odbc_missing_state" does not exist
Through Connector/ODBC, native error 1064 maps to SQLSTATE 42000 for ODBC 3 and 37000 for ODBC 2. The upstream ODBC diagnostic tests therefore fail:
ODBC 3: actual 42000, expected 42S02
ODBC 2: actual 37000, expected S0002
Expected behavior
A missing base table should use the MySQL-compatible native error code 1146 (ER_NO_SUCH_TABLE). Connector/ODBC maps that code to the standard ODBC SQLSTATE 42S02 (Base table or view not found), or S0002 for an ODBC 2 environment.
For comparison, MatrixOne already emits native error 1050 for an existing table, allowing the driver to map duplicate-table errors to 42S01.
Impact
ODBC clients including Power BI classify failures by SQLSTATE to distinguish missing objects from SQL syntax errors. Returning 1064 makes an object-lifecycle error look like invalid SQL, weakens retry/schema-refresh diagnostics, and makes the fault appear to be in generated SQL rather than catalog state.
Regression coverage
The MatrixOne-specific ODBC suite checks syntax, missing-table, and duplicate-object diagnostics. The missing-table assertion should require exact SQLSTATE 42S02 once the server returns native error 1146.
Independent replay on the official matrixorigin/matrixone:latest image — arm64/linux, VERSION() = 8.0.30-MatrixOne-v4.2.5, single-node standalone, Apple M5 host, mysql 8.4 CLI. This comment does not assert anything about current main; it only records that the behaviour is still present in this release image.
Still reproducible, both signatures:
case
MO v4.2.5
MySQL 8.0.46
SELECT * FROM not_exist_tbl
ERROR 1064 (42000) "table ... does not exist"
ERROR 1146 (42S02)
SELECT no_col FROM t
ERROR 20301 (HY000)
ERROR 1054 (42S22)
Error-driven fallbacks (ODBC/SQLSTATE handling, data-source detection, retry logic keyed on "table missing") do not work against these codes.
Activity
fix(plan): return MySQL 1146 for missing tables (#26708)
iamlinjunhong commentedon Aug 5, 2026
Verified fixed on MatrixOne main e31ee06, via 4b62e3e (fix(plan): return MySQL 1146 for missing tables, #26708).
Evidence:
The remaining two my_error failures are unrelated MySQL-only account/password-expiration and stored-procedure behavior.
fix(plan): return MySQL 1146 for missing tables (matrixorigin#26708)
fix(plan): return MySQL 1146 for missing tables (matrixorigin#26708)
fix(plan): return MySQL 1146 for missing tables (matrixorigin#26708)
daviszhen commentedon Oct 16, 2026
v4.2.5 release-specific reproduction (arm64)
Independent replay on the official
matrixorigin/matrixone:latestimage — arm64/linux,VERSION()=8.0.30-MatrixOne-v4.2.5, single-node standalone, Apple M5 host, mysql 8.4 CLI. This comment does not assert anything about currentmain; it only records that the behaviour is still present in this release image.Still reproducible, both signatures:
SELECT * FROM not_exist_tblERROR 1064 (42000)"table ... does not exist"ERROR 1146 (42S02)SELECT no_col FROM tERROR 20301 (HY000)ERROR 1054 (42S22)Error-driven fallbacks (ODBC/SQLSTATE handling, data-source detection, retry logic keyed on "table missing") do not work against these codes.