{"record":{"id":"faf5459092b7f6c7","repo":"t8y2/dbx","slug":"type-details-are-not-supported-in-mysql-compatibil-faf545","errorCode":null,"errorMessage":"type details are not supported in MySQL compatibility mode","messagePattern":"type details are not supported in MySQL compatibility mode","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/vastbase-go/vastbase_metadata.go","lineNumber":594,"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":576,"sourceCodeEnd":612,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/vastbase-go/vastbase_metadata.go#L576-L612","documentation":"getTypeDetails refuses to run PostgreSQL catalog queries against a server running in MySQL compatibility mode, where sys_catalog SQL is invalid. The agent fails fast with this explicit error instead of emitting confusing SQL errors.","triggerScenarios":"Calling the custom-type details metadata RPC on a vastbase/openGauss server configured with MySQL compatibility mode (s.mode.mysqlCompat true).","commonSituations":"Connecting the agent to a MySQL-compat-mode database and then inspecting user-defined types; a config where the compat mode was enabled server-side but the client assumed PostgreSQL catalog support.","solutions":["Switch the database out of MySQL compatibility mode if type details are needed","Avoid custom-type metadata RPCs on MySQL-compat-mode servers; rely on the metadata the agent supports there","Reconnect with a mode where postgresCatalog/sys_catalog queries are valid"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if serverMode.MySQLCompat { skipTypeDetails() } else { agent.GetTypeDetails(ctx, schema, name) }","typeGuard":null,"tryCatchPattern":"d, err := agent.GetTypeDetails(ctx, schema, name)\nif err != nil && strings.Contains(err.Error(), \"MySQL compatibility\") { return ErrTypeDetailsUnsupported }","preventionTips":["Check the server compatibility mode after connect","Hide/disable custom-type detail UI in MySQL-compat mode","Document mode capability differences in client feature flags"],"tags":["mysql-compatibility","unsupported","metadata"],"backgroundTag":"unsupported-compatibility-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"}