{"record":{"id":"341a67c0fa62eec1","repo":"risingwavelabs/risingwave","slug":"unknown-mysql-data-type","errorCode":null,"errorMessage":"Unknown MySQL data type","messagePattern":"Unknown MySQL data type","errorType":"validation","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/external/mysql.rs","lineNumber":447,"sourceCode":"            return Err(anyhow!(\"LINE string type not supported\").into());\n        }\n        ColumnType::Polygon(_) => {\n            return Err(anyhow!(\"POLYGON type not supported\").into());\n        }\n        ColumnType::MultiPoint(_) => {\n            return Err(anyhow!(\"MULTI POINT type not supported\").into());\n        }\n        ColumnType::MultiLineString(_) => {\n            return Err(anyhow!(\"MULTI LINE STRING type not supported\").into());\n        }\n        ColumnType::MultiPolygon(_) => {\n            return Err(anyhow!(\"MULTI POLYGON type not supported\").into());\n        }\n        ColumnType::GeometryCollection(_) => {\n            return Err(anyhow!(\"GEOMETRY COLLECTION type not supported\").into());\n        }\n        ColumnType::Unknown(_) => {\n            return Err(anyhow!(\"Unknown MySQL data type\").into());\n        }\n    };\n\n    Ok(dtype)\n}\n\npub struct MySqlExternalTableReader {\n    rw_schema: Schema,\n    pk_indices: Vec<usize>,\n    field_names: String,\n    pool: mysql_async::Pool,\n    upstream_mysql_pk_infos: Vec<(String, ColumnType)>, // (column_name, column_type)\n    mysql_version: (u8, u8),\n    is_mariadb: bool,\n}\n\nimpl ExternalTableReader for MySqlExternalTableReader {\n    async fn current_cdc_offset(&self) -> ConnectorResult<CdcOffset> {","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/external/mysql.rs#L429-L465","documentation":"The mapper hit a MySQL ColumnType::Unknown — a type byte it cannot recognize at all — so it cannot produce a RisingWave DataType and returns this error. Unlike the spatial types, this signals the connector didn't even identify the type, usually meaning a very new or exotic MySQL type.","triggerScenarios":"connect or parse_schema_change encounters a column whose mysql-parser ColumnType resolves to Unknown (unrecognized type code in the binary-log/schema payload).","commonSituations":"Very new MySQL/MariaDB versions introducing new types, proxies emitting unusual metadata, or vendor-specific column types (e.g. some TiDB/Aurora specifics) appearing in CDC schema.","solutions":["Check the MySQL server/version; upgrade the mysql parser dependency (rust-cdc-connect crate) so new type codes are recognized.","Alter the offending column to a standard supported type.","Inspect the upstream schema and remove/vendor-specific columns from the CDC table.","Report the unrecognized type to RisingWave with server version and schema."],"exampleFix":"// before (upstream)\nCREATE TABLE t (id INT PRIMARY KEY, weird_col VENDOR_TYPE);\n// after\nALTER TABLE t MODIFY weird_col VARCHAR(255);","handlingStrategy":"try-catch","validationCode":"// Verify all upstream column types are known standard MySQL types before CDC:\nlet known = [\"tinyint\",\"smallint\",\"mediumint\",\"int\",\"bigint\",\"decimal\",\"float\",\"double\",\"bit\",\"date\",\"datetime\",\"timestamp\",\"time\",\"year\",\"char\",\"varchar\",\"binary\",\"varbinary\",\"blob\",\"text\",\"enum\",\"set\",\"json\"];\nfor col in mysql_columns {\n    if !known.iter().any(|t| col.data_type.eq_ignore_ascii_case(t)) && !col.data_type.eq_ignore_ascii_case(\"geometry\") {\n        eprintln!(\"non-standard column type: {} {}\", col.name, col.data_type);\n    }\n}","typeGuard":null,"tryCatchPattern":"match connect_mysql_cdc(schema).await {\n    Err(e) if e.to_string().contains(\"Unknown MySQL data type\") => {\n        eprintln!(\"Unrecognized column type; check MySQL version/parser support: {e}\");\n    }\n    other => other?,\n}","preventionTips":["Pin a MySQL/MariaDB version known to work with RisingWave CDC.","Keep connector dependencies updated for new type codes.","Avoid vendor-specific column types in CDC tables.","Log the full upstream schema when CDC setup fails."],"tags":["cdc","mysql","unknown-type","schema"],"backgroundTag":"invalid-enum-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}