Skip to content

[Bug]: information_schema.columns.DATA_TYPE uppercase values break ODBC SQLColumns type mapping #26680

Closed

Description

@iamlinjunhong

Is there an existing issue for the same bug?

  • I have checked the existing issues.

ODBC umbrella issue: #26677

Branch Name

m-25908

Commit ID

35252dd

The running server reports 8.0.30-MatrixOne-v25908.

Other Environment Information

  • Hardware parameters: Apple Silicon ARM64, 10 logical CPUs
  • OS type: macOS 15.5, Darwin 24.5.0
  • Deployment: fresh local launch with etc/launch/launch.toml
  • Client: MatrixOne ODBC derived from MySQL Connector/ODBC 9.7.0 through unixODBC 2.3.14

Actual Behavior

MatrixOne returns uppercase type names from information_schema.columns.DATA_TYPE, for example INT, VARCHAR, DECIMAL, and DATETIME.

MySQL Connector/ODBC 9.7 maps this field through a case-sensitive table containing lowercase MySQL type names. As a result, the public ODBC SQLColumns API reports SQL_UNKNOWN_TYPE (0) for almost every MatrixOne column. JSON happens to map because the upstream table contains both json and JSON entries.

Observed SQLColumns.DATA_TYPE values for a 20-column MatrixOne table:

id          0
c_tiny      0
c_small     0
c_int       0
c_big       0
c_dec       0
c_float     0
c_double    0
c_bool      0
c_date      0
c_time      0
c_dt        0
c_ts        0
c_char      0
c_varchar   0
c_text      0
c_binary    0
c_varbinary 0
c_blob      0
c_json     -1

Direct result metadata from SELECT can still report useful types, so this defect is easy to miss in connection smoke tests. BI catalog discovery and Power BI Navigator use SQLColumns and can receive unknown types even though ordinary queries work.

Expected Behavior

MatrixOne information_schema compatibility should match MySQL casing for standardized string values, or MatrixOne should otherwise guarantee that MySQL-compatible connectors can consume them.

For the existing Connector/ODBC behavior, SQLColumns should report SQL_INTEGER, SQL_BIGINT, SQL_DECIMAL, SQL_TYPE_DATE, SQL_WVARCHAR or SQL_VARCHAR, SQL_VARBINARY, and the other corresponding ODBC types instead of SQL_UNKNOWN_TYPE.

Steps to Reproduce

Create a table:

CREATE DATABASE IF NOT EXISTS mo_odbc_deep;
CREATE TABLE mo_odbc_deep.type_probe (
  id INT PRIMARY KEY,
  name VARCHAR(128),
  amount DECIMAL(20,6),
  event_date DATE,
  payload VARBINARY(128)
);

Inspect MatrixOne information_schema:

SELECT column_name, data_type, column_type
FROM information_schema.columns
WHERE table_schema = "mo_odbc_deep"
  AND table_name = "type_probe"
ORDER BY ordinal_position;

Observed MatrixOne result:

id         INT       INT(32)
name       VARCHAR   VARCHAR(128)
amount     DECIMAL   DECIMAL(20,6)
event_date DATE      DATE(0)
payload    VARBINARY VARBINARY(128)

Then connect through MySQL Connector/ODBC 9.7 or the experimental MatrixOne ODBC driver and call SQLColumns for mo_odbc_deep.type_probe. Fetch result column 5, DATA_TYPE. Values are 0 rather than the expected ODBC type identifiers.

Additional information

Connector/ODBC 9.7 calls get_sql_data_type_from_str on the information_schema DATA_TYPE string. Its sql_data_types_map is case sensitive and predominantly lowercase.

A defensive MatrixOne ODBC workaround can normalize the server value before lookup, but matching MySQL information_schema behavior in MatrixOne would also protect other connectors that assume MySQL casing.

Suggested regression coverage:

  • Compare string-valued information_schema columns with MySQL casing.
  • Assert SQLColumns.DATA_TYPE for every MatrixOne scalar type.
  • Cover both ANSI and Unicode ODBC driver variants.
  • Keep direct SELECT result metadata and catalog metadata consistent.

Activity

  1. self-assigned this
    on Aug 4, 2026
  2. added a commit that references this issue on Aug 5, 2026
    a8bcaf1
  3. added
    ai-easy
    on Aug 7, 2026
  4. Repository owner unassigned on Aug 10, 2026
  5. ghost assigned on Aug 10, 2026
  6. slyunnn commented on Aug 10, 2026

    @slyunnn

    Regression and extended verification for #26680 (2026-08-10)

    Follow-up to the ODBC SQLColumns type-mapping failure: verified the information_schema.columns.DATA_TYPE
    compatibility fix and added MOTR regression coverage.

    Verification environment

    • MatrixOne branch: main
    • MatrixOne commit: fa0ea95aa77b59a2947159baab31e7215d040e93
      • fix(plan): support subqueries in left and right join ON clauses (#26763)
    • MOTR branch: test/issue-26680-information-schema-data-type
    • MOTR commit: f2f7c08eb0c61f3ff8ebf93bdf8401e8f0f4a8c4

    Regression validation

    Extended MOTR coverage

    Added:

    suites/14_issue_regression/t/issue_26680_information_schema_data_type.test
    suites/14_issue_regression/r/issue_26680_information_schema_data_type.result

    Covered information_schema.columns.DATA_TYPE and COLUMN_TYPE for:

    • INT
    • DECIMAL(20,6)
    • DATETIME(6)
    • VARCHAR
    • TEXT
    • VARBINARY
    • BLOB
    • BOOL
    • TINYINT UNSIGNED
    • BIGINT UNSIGNED
    • ENUM
    • SET

    Assertions include:

    • DATA_TYPE is lowercase for every tested column.
    • BOOL is exposed as connector-compatible tinyint.
    • DATA_TYPE remains canonical, while COLUMN_TYPE preserves full MatrixOne declarations such as BOOL(0), INT
      UNSIGNED(32), and type precision/length.

    Test result

    Recorded the expected result and reran it in comparison mode:

    [ISSUE_26680_INFORMATION_SCHEMA_DATA_TYPE] success | stmts=7 ok=7 fail=0

    Conclusion

    The underlying compatibility bug is already fixed by #26712. The new MOTR regression protects the connector-facing
    lowercase DATA_TYPE contract and prevents a future regression that would cause ODBC SQLColumns to return
    SQL_UNKNOWN_TYPE for common MatrixOne column types.

    Follow-up

    Create the MOTR PR from:

    https://github.com/matrixorigin/motr/pull/new/test/issue-26680-information-schema-data-type

    Suggested resolution: merge the MOTR regression, reference #26712 as the product fix, and close #26680.

  7. assigned and unassigned on Aug 10, 2026
  8. assigned and unassigned on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ai-easyarea/compatibilitykind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions