{"record":{"id":"3a297c7ff7b9bafa","repo":"risingwavelabs/risingwave","slug":"failed-to-deserialize-mysql-value-into-rw-value","errorCode":null,"errorMessage":"failed to deserialize MySQL value into rw value","messagePattern":"failed to deserialize MySQL value into rw value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/parser/mysql.rs","lineNumber":54,"sourceCode":"    ($row:expr, $i:expr, $name:expr, $typ:ty) => {{\n        match $row.take_opt::<Option<$typ>, _>($i) {\n            None => bail!(\"no value found at column: {}, index: {}\", $name, $i),\n            Some(Ok(val)) => Ok(val.map(|v| ScalarImpl::from(v))),\n            Some(Err(e)) => Err(anyhow::Error::new(e.clone())\n                .context(\"failed to deserialize MySQL value into rust value\")\n                .context(format!(\n                    \"column: {}, index: {}, rust_type: {}\",\n                    $name,\n                    $i,\n                    stringify!($typ),\n                ))),\n        }\n    }};\n    ($row:expr, $i:expr, $name:expr, $typ:ty, $rw_type:ty) => {{\n        match $row.take_opt::<Option<$typ>, _>($i) {\n            None => bail!(\"no value found at column: {}, index: {}\", $name, $i),\n            Some(Ok(val)) => Ok(val.map(|v| ScalarImpl::from(<$rw_type>::from(v)))),\n            Some(Err(e)) => Err(anyhow::Error::new(e.clone())\n                .context(\"failed to deserialize MySQL value into rw value\")\n                .context(format!(\n                    \"column: {}, index: {}, rw_type: {}\",\n                    $name,\n                    $i,\n                    stringify!($rw_type),\n                ))),\n        }\n    }};\n}\n\nmacro_rules! handle_data_type_with_signed {\n    (\n        $mysql_row:expr,\n        $mysql_datum_index:expr,\n        $column_name:expr,\n        $signed_type:ty,\n        $unsigned_type:ty","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/parser/mysql.rs#L36-L72","documentation":"Second arm of `handle_data_type!` (RW-type conversion path): the MySQL client returned `Some(Err(e))` from `take_opt`, wrapped with context \"failed to deserialize MySQL value into rw value\" plus column name, index, and target RW type. The raw value could not be read/converted into the intermediate RisingWave scalar type.","triggerScenarios":"The MySQL value at column `$i` cannot be deserialized into `$rw_type` (wire type incompatible with the RW conversion, e.g. non-numeric text read into a Decimal/Int conversion).","commonSituations":"Upstream column type change not reflected in the RW schema; unsigned/precision conversions failing; charset or data corruption in a specific row; wrong entry in the MySQL-to-RW type mapping.","solutions":["Inspect the wrapped inner error plus the column/index/rw_type context to pinpoint the failing column.","Correct the RW column type (or the type mapping entry) to match the actual MySQL column type.","Fix or remove the offending data upstream and restart the snapshot/replication."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match decode_col_rw(row, idx, name) {\n    Err(e) if e.to_string().contains(\"failed to deserialize MySQL value into rw value\") => {\n        tracing::error!(\"rw conversion failed: {e:#}\");\n        quarantine_row(row_id);\n    }\n    other => other?,\n}","preventionTips":["Map MySQL types to RW types via a single reviewed mapping table, not ad-hoc conversions.","Test the type mapping against the actual server version in CI.","Log the full anyhow context chain ({e:#}) to see column/index/type details."],"tags":["mysql","cdc","deserialization","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}