Skip to content

MySQL LONG VARCHAR and LONG VARBINARY type aliases are rejected by the parser #26686

Closed

Description

@iamlinjunhong

MatrixOne version

  • Server: 8.0.30-MatrixOne-v25908
  • Commit: 35252ddec751e82f5a7209c6e242ed247626f3d6
  • Compatibility test: MySQL Connector/ODBC 9.7.0 upstream my_blob suite

Reproduction

create table odbc_long_text (id int, value long varchar);
create table odbc_long_binary (id int, value long varbinary);

Both statements fail with SQL parser error 1064 / SQLSTATE 42000.

Expected behavior

For MySQL wire/SQL compatibility, accept the MySQL aliases used by Connector/ODBC compatibility tests:

  • LONG VARCHAR as a long text type
  • LONG VARBINARY as a long binary/blob type

The exact canonical MatrixOne type used internally may remain TEXT / BLOB; the compatibility requirement is that these DDL spellings parse and preserve long character/binary values.

Impact

The upstream ODBC LOB suite cannot reach its SQLPutData, one-piece long-value write, and long-binary retrieval checks because fixture creation fails first. Four independent upstream cases stop at these two type aliases, which makes protocol/driver behavior look broken before any ODBC data-at-execution API is exercised.

A MatrixOne-native deep ODBC test using TEXT and BLOB confirms that 64 KiB chunked SQLPutData / SQLGetData works, so this report is specifically about SQL compatibility aliases, not LOB transport.

Activity

  1. self-assigned this
    on Aug 4, 2026
  2. added
    ai-easy
    on Aug 5, 2026
  3. ghost closed this as completedon Aug 6, 2026
  4. Ariznawlll commented on Oct 22, 2026

    @Ariznawlll
    Collaborator

    Follow-up on the MySQL type-alias family: after the LONG VARCHAR/LONG VARBINARY fix, three more documented MySQL aliases remain rejected by the parser on current main (dev build 3a1e42b430, 2026-10-22):

    1. SERIAL (= BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE):

    CREATE TABLE sr (id SERIAL PRIMARY KEY, v INT);
    -- MatrixOne: ERROR 1064 ... syntax error ... near " serial primary key, v int)"
    -- MySQL 8.0.45: accepted; SHOW CREATE renders
    --   `id` bigint unsigned NOT NULL AUTO_INCREMENT ... UNIQUE KEY `id` (`id`)

    2. DEC and FIXED (= DECIMAL):

    CREATE TABLE al (id INT PRIMARY KEY, a DEC(5,2), b FIXED(5,2) /* , c NUMERIC(5,2) works */);
    -- MatrixOne: ERROR 1064 ... near " dec(5,2), b fixed(5,2), c numeric(5,2))"
    -- MySQL 8.0.45: accepted; DEC/FIXED/NUMERIC all render as decimal(5,2)

    (NUMERIC already works on MatrixOne — only DEC and FIXED are missing, both documented at https://dev.mysql.com/doc/refman/8.0/en/numeric-types.html — "DEC, DECIMAL, FIXED" and SERIAL at https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html.)

    3. ZEROFILL is accepted but silently inert (parser takes it, storage ignores it, SHOW CREATE drops it) —MATRIXOne:

    CREATE TABLE zf (id INT PRIMARY KEY, z INT ZEROFILL);
    SHOW CREATE TABLE zf;   -- no ZEROFILL in output (MySQL: `z` int(10) unsigned zerofill)
    INSERT INTO zf VALUES (1, 42);
    SELECT z FROM zf;       -- MatrixOne: 42 | MySQL: 0000000042

    I know #6571 closed ZEROFILL as "accepting it won't be implemented" — the residual problem worth noting is that DDL accepts the attribute then silently changes display/storage semantics and the show-create round-trip, which is a "postural contradiction" rather than an explicit unsupported-error: ORM/schema diff tools comparing MySQL and MatrixOne DDL see equal input DDL but divergent behavior and divergent SHOW CREATE output.

    SERIAL is the substantive compatibility gap here: phpMyAdmin-generated schemas, older CakePHP/Yii migrations, and countless pg_dump-to-mysql conversion tools emit SERIAL for surrogate PKs; they currently hard-fail with 1064 at CREATE time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-easyarea/compatibilitykind/bugphase/testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions