{"record":{"id":"ef460397cc18f116","repo":"t8y2/dbx","slug":"type-details-are-not-supported-in-mysql-compatibil","errorCode":null,"errorMessage":"type details are not supported in MySQL compatibility mode","messagePattern":"type details are not supported in MySQL compatibility mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/kingbase-go/kingbase_metadata.go","lineNumber":664,"sourceCode":"LEFT JOIN %s opc ON opc.oid = r.rngsubopc\nLEFT JOIN %s ncan ON ncan.oid = pcan.pronamespace\nLEFT JOIN %s ndiff ON ndiff.oid = pdiff.pronamespace\nLEFT JOIN %s nopc ON nopc.oid = opc.opcnamespace\nWHERE r.rngmultitypid = %%d`, rangeSubtype, rangeTable, typeTable, namespaceTable, typeTable, namespaceTable, procTable, procTable, opclassTable, namespaceTable, namespaceTable, namespaceTable),\n\t\trangeMultirange: fmt.Sprintf(`SELECT mt.typname\nFROM %s r\nJOIN %s mt ON mt.oid = r.rngmultitypid\nWHERE r.rngtypid = %%d`, rangeTable, typeTable),\n\t\tcollationName: fmt.Sprintf(`SELECT quote_ident(ncl.nspname) || '.' || quote_ident(cl.collname) FROM %s cl JOIN %s ncl ON ncl.oid = cl.collnamespace WHERE cl.oid = %%d`, collationTable, namespaceTable),\n\t}\n}\n\n// getTypeDetails returns read-only details of a user-defined type. MySQL\n// compatibility mode is explicitly unsupported instead of running PostgreSQL\n// catalog SQL against a MySQL-mode server.\nfunc (s *server) getTypeDetails(schema, name string) (*customTypeDetails, error) {\n\tif s.mode.mysqlCompat {\n\t\treturn nil, errors.New(\"type details are not supported in MySQL compatibility mode\")\n\t}\n\tschema = strings.TrimSpace(schema)\n\tname = strings.TrimSpace(name)\n\tif schema == \"\" || name == \"\" {\n\t\treturn nil, errors.New(\"schema and type name are required\")\n\t}\n\tif isSystemSchema(schema) {\n\t\treturn nil, fmt.Errorf(\"system schema %s is not supported for custom type details\", schema)\n\t}\n\tcatalog := \"sys_catalog\"\n\tif s.mode.postgresCatalog {\n\t\tcatalog = \"pg_catalog\"\n\t}\n\tprefix := catalogPrefix(catalog)\n\tqueries := customTypeCatalogQueriesFor(catalog, prefix, schema, name)\n\n\trows, err := s.metadataQuery(queries.general)\n\tif err != nil {","sourceCodeStart":646,"sourceCodeEnd":682,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/kingbase-go/kingbase_metadata.go#L646-L682","documentation":"In MySQL compatibility mode, Kingbase does not expose the PostgreSQL catalog views this driver uses to introspect user-defined types, so getTypeDetails refuses the request up front rather than running incompatible SQL. It is a deliberate capability guard.","triggerScenarios":"Calling the type-details metadata API for a user-defined type while the server connection was established in MySQL compatibility mode (s.mode.mysqlCompat == true).","commonSituations":"Pointing the driver at a Kingbase instance initialized with a MySQL-mode database; reusing a metadata tool written for PostgreSQL mode against a MySQL-mode server; misconfigured DSN selecting the wrong compatibility mode.","solutions":["Connect to a Kingbase database in PostgreSQL compatibility mode when type-details introspection is needed","Skip or degrade the type-details feature in the application when mysqlCompat mode is detected","Verify the DSN/target database compatibility mode; the mode may have been chosen unintentionally"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if s.mode.mysqlCompat { /* skip type-details or use a degraded code path */ }","typeGuard":null,"tryCatchPattern":"details, err := s.getTypeDetails(schema, name); if err != nil && strings.Contains(err.Error(), \"MySQL compatibility\") { details = nil /* degrade gracefully */ }","preventionTips":["Detect mysqlCompat mode once at connect time and disable PostgreSQL-catalog features","Document mode-dependent capability limits in your tooling","Confirm the database compatibility mode in the DSN/environment before relying on catalog introspection"],"tags":["metadata","mysql-compatibility","unsupported-feature"],"backgroundTag":"feature-not-supported-in-mode","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}