{"record":{"id":"30f5141088d682db","repo":"googleapis/mcp-toolbox","slug":"unable-to-parse-row-w-30f514","errorCode":null,"errorMessage":"unable to parse row: %w","messagePattern":"unable to parse row: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/singlestore/singlestore.go","lineNumber":143,"sourceCode":"\n\t// create an array of values for each column, which can be re-used to scan each row\n\trawValues := make([]any, len(cols))\n\tvalues := make([]any, len(cols))\n\tfor i := range rawValues {\n\t\tvalues[i] = &rawValues[i]\n\t}\n\tdefer results.Close()\n\n\tcolTypes, err := results.ColumnTypes()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to get column types: %w\", err)\n\t}\n\n\tout := []any{}\n\tfor results.Next() {\n\t\terr := results.Scan(values...)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse row: %w\", err)\n\t\t}\n\t\tvMap := make(map[string]any)\n\t\tfor i, name := range cols {\n\t\t\tval := rawValues[i]\n\t\t\tif val == nil {\n\t\t\t\tvMap[name] = nil\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvMap[name], err = mysqlcommon.ConvertToType(colTypes[i], val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"errors encountered when converting values: %w\", err)\n\t\t\t}\n\t\t}\n\t\tout = append(out, vMap)\n\t}\n\n\tif err := results.Err(); err != nil {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/singlestore/singlestore.go#L125-L161","documentation":"RunSQL wraps results.Scan(values...) errors with this message. Scan failed while copying a row's column values into the pre-allocated []any slots — the driver could not convert a server value into the destination representation, or the row shape did not match the column count.","triggerScenarios":"results.Next() returned a row and Scan failed, e.g. a driver-level decode failure for a value type, NULL handling mismatch, or column count/destination length mismatch.","commonSituations":"Unusual SingleStore column types (e.g. large decimals, JSON, geometry) the MySQL driver struggles to scan into a plain any slot; corrupt/aborted result stream; server version producing unexpected wire types.","solutions":["Read the wrapped Scan error to identify which column/value failed.","Cast problematic columns explicitly in SQL (e.g. CAST(col AS CHAR)) to a well-supported type.","Check for driver/version incompatibilities and update go-sql-driver/mysql.","Test the same query via the `mysql` CLI to confirm server-side data is valid.","If a specific column type always fails, avoid SELECT * and select only supported columns."],"exampleFix":"// before\nSELECT * FROM events\n// after (cast problematic column)\nSELECT id, CAST(geom AS CHAR) AS geom FROM events","handlingStrategy":"validation","validationCode":"-- Pre-check column types before running the tool\nSHOW COLUMNS FROM my_table;\n-- Replace unsupported types in the query:\n-- SELECT id, CAST(weird_col AS CHAR) AS weird_col FROM my_table","typeGuard":null,"tryCatchPattern":"out, err := source.RunSQL(ctx, stmt, params)\nif err != nil {\n    var scanErr error\n    if strings.Contains(err.Error(), \"unable to parse row\") {\n        scanErr = fmt.Errorf(\"row decode failed; cast unsupported columns: %w\", err)\n    }\n    return out, scanErr\n}","preventionTips":["CAST unusual columns (JSON, geometry, decimals) to CHAR in queries","Validate table data for zero-dates or corrupt values","Avoid SELECT * on wide/legacy tables","Keep the MySQL driver updated"],"tags":["singlestore","sql","scan","types"],"backgroundTag":"row-scan-type-mismatch","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}