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
information_schema character metadata is empty or inconsistent, breaking Unicode ODBC SQLColumns classification #26688
information_schema.character_sets should contain the supported character sets and their MAXLEN values.
Character columns should reference rows that can be joined by CHARACTER_SET_NAME.
CHARACTER_OCTET_LENGTH should reflect the declared character length multiplied by the character sets actual maximum encoded width, rather than the current factor of 24 for utf8.
ODBC impact
Connector/ODBC implements SQLColumns by joining information_schema.columns to information_schema.character_sets. It uses MAXLEN > 1 to classify Unicode-driver character columns as SQL_WCHAR, SQL_WVARCHAR, and SQL_WLONGVARCHAR. Because MatrixOne returns no matching row, MAXLEN is NULL and the Unicode driver incorrectly reports VARCHAR as ANSI SQL_VARCHAR (12) instead of SQL_WVARCHAR (-9). The upstream t_bug34355094_sqlcolumns_wchar regression fails for CHAR, VARCHAR, and TEXT.
Power BI consumes SQLColumns for schema discovery, so both the wrong wide/ANSI classification and inflated octet lengths can affect Unicode schema inference and buffer sizing.
A small driver fallback can avoid the type-classification symptom when CHARACTER_SET_NAME is non-NULL, but it cannot make the server metadata internally consistent; the information schema should be fixed at the source.
PR #26695 addressed two separate parts of the problem, but the Aug 5 reproduction still failed for two independent reasons:
Existing tenants already at 4.0.6 did not execute the new offset upgrade handler because the old tenant-upgrade path treated a same-version 4.0.6 -> 4.0.6 transition as a no-op. PR fix: lowercase information_schema columns data types #26712 later fixed same-version offset upgrades. This explains why information_schema.character_sets could remain empty on an upgraded tenant even though the seed SQL had been added.
TEXT still reported 0/0 because an ordinary MatrixOne TEXT column is persisted as T_text with Width=0, and the internal information-schema functions returned that marker literally. The CHAR/VARCHAR character-vs-octet calculation from fix(metadata): correct character set metadata #26695 was already working.
I prepared the remaining fix on branch m2-26688:
ordinary TEXT now exposes MySQL-compatible metadata 65535 characters / 65535 octets;
TINYTEXT exposes 255 / 255, preserving the fact that TEXT-family limits are byte bounds;
CHAR/VARCHAR remain declared character length and UTF-8 maximum octet length (4x);
the charset/collation BVT now covers CHAR, VARCHAR, TINYTEXT, TEXT, and the character_sets MAXLEN join used by ODBC SQLColumns.
Verification:
pkg/sql/plan/function unit test: PASS
go test ./pkg/sql/plan/function: PASS
go build ./pkg/sql/plan/function: PASS
go vet ./pkg/sql/plan/function: PASS
mo-tester charset_collation_basic.sql against a freshly built local service: 275/275 statements passed, 0 failed, 100% success rate.
Activity
iamlinjunhong commentedon Aug 12, 2026
Follow-up analysis on latest main:
PR #26695 addressed two separate parts of the problem, but the Aug 5 reproduction still failed for two independent reasons:
I prepared the remaining fix on branch m2-26688:
Verification: