risingwavelabs/risingwave · error · ConnectorError
Unknown MySQL data type
Error message
Unknown MySQL data type
What it means
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.
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.
Example fix
// before (upstream) CREATE TABLE t (id INT PRIMARY KEY, weird_col VENDOR_TYPE); // after ALTER TABLE t MODIFY weird_col VARCHAR(255);
Defensive patterns
Strategy: try-catch
Validate before calling
// Verify all upstream column types are known standard MySQL types before CDC:
let known = ["tinyint","smallint","mediumint","int","bigint","decimal","float","double","bit","date","datetime","timestamp","time","year","char","varchar","binary","varbinary","blob","text","enum","set","json"];
for col in mysql_columns {
if !known.iter().any(|t| col.data_type.eq_ignore_ascii_case(t)) && !col.data_type.eq_ignore_ascii_case("geometry") {
eprintln!("non-standard column type: {} {}", col.name, col.data_type);
}
} Try / catch
match connect_mysql_cdc(schema).await {
Err(e) if e.to_string().contains("Unknown MySQL data type") => {
eprintln!("Unrecognized column type; check MySQL version/parser support: {e}");
}
other => other?,
} Prevention
- 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.
When it happens
Trigger: connect or parse_schema_change encounters a column whose mysql-parser ColumnType resolves to Unknown (unrecognized type code in the binary-log/schema payload).
Common situations: 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.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- MySQL table doesn't define the primary key
- unsupported data type
- BIT( ) type not supported
- Column type mismatch
- snapshot primary key ` ` cannot be NULL
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/341a67c0fa62eec1.
Report an issue: GitHub.
Appendix: source
Thrown at src/connector/src/source/cdc/external/mysql.rs:447
return Err(anyhow!("LINE string type not supported").into());
}
ColumnType::Polygon(_) => {
return Err(anyhow!("POLYGON type not supported").into());
}
ColumnType::MultiPoint(_) => {
return Err(anyhow!("MULTI POINT type not supported").into());
}
ColumnType::MultiLineString(_) => {
return Err(anyhow!("MULTI LINE STRING type not supported").into());
}
ColumnType::MultiPolygon(_) => {
return Err(anyhow!("MULTI POLYGON type not supported").into());
}
ColumnType::GeometryCollection(_) => {
return Err(anyhow!("GEOMETRY COLLECTION type not supported").into());
}
ColumnType::Unknown(_) => {
return Err(anyhow!("Unknown MySQL data type").into());
}
};
Ok(dtype)
}
pub struct MySqlExternalTableReader {
rw_schema: Schema,
pk_indices: Vec<usize>,
field_names: String,
pool: mysql_async::Pool,
upstream_mysql_pk_infos: Vec<(String, ColumnType)>, // (column_name, column_type)
mysql_version: (u8, u8),
is_mariadb: bool,
}
impl ExternalTableReader for MySqlExternalTableReader {
async fn current_cdc_offset(&self) -> ConnectorResult<CdcOffset> {View on GitHub (pinned to 6469eb736d)