{"record":{"id":"21e7233bf7ba60af","repo":"googleapis/mcp-toolbox","slug":"unable-to-parse-row-w-21e723","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/tidb/tidb.go","lineNumber":141,"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\t// mysql driver return []uint8 type for \"TEXT\", \"VARCHAR\", and \"NVARCHAR\"\n\t\t\t// we'll need to cast it back to string\n\t\t\tswitch colTypes[i].DatabaseTypeName() {\n\t\t\tcase \"JSON\":\n\t\t\t\t// unmarshal JSON data before storing to prevent double\n\t\t\t\t// marshaling\n\t\t\t\tbyteVal, ok := val.([]byte)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"expected []byte for JSON column, but got %T\", val)","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/tidb/tidb.go#L123-L159","documentation":"results.Scan failed to copy the current row into the destination slice in RunSQL — a value could not be converted into the allocated scan target for that column.","triggerScenarios":"Thrown at internal/sources/tidb/tidb.go:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the failing column","Cast the problematic column in the SQL (e.g. CONVERT/CAST)","Check for NULL handling mismatches"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}