{"record":{"id":"4555278206b9a18e","repo":"googleapis/mcp-toolbox","slug":"unable-to-get-column-types-w-455527","errorCode":null,"errorMessage":"unable to get column types: %w","messagePattern":"unable to get column types: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/singlestore/singlestore.go","lineNumber":136,"sourceCode":"\t\treturn nil, fmt.Errorf(\"unable to execute query: %w\", err)\n\t}\n\n\tcols, err := results.Columns()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to retrieve rows column name: %w\", err)\n\t}\n\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 {","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/singlestore/singlestore.go#L118-L154","documentation":"RunSQL wraps results.ColumnTypes() errors with this message. ColumnTypes() fetches per-column type information needed to convert raw driver values into Go types (via ConvertToType); failure indicates the result set metadata could not be fully retrieved from the driver.","triggerScenarios":"After Columns() succeeds, results.ColumnTypes() returns an error — usually the same class of connection/protocol failure as Columns(), e.g. the connection died while fetching extended column type metadata.","commonSituations":"Mid-query network failure, server closed the connection, driver/protocol mismatch with an unusual column type, or a proxy truncating the response.","solutions":["Inspect the wrapped driver error for the precise protocol/network cause.","Retry the query to rule out a transient connection drop.","Check network path (load balancers, proxies) for idle/short timeouts and raise them.","Confirm the SingleStore server version is supported by the MySQL driver in use.","If reproducible for a specific statement, simplify the query's column expressions to isolate the offending type."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"out, err := source.RunSQL(ctx, stmt, params)\nif err != nil && strings.Contains(err.Error(), \"unable to get column types\") {\n    // log and retry once; fall back to a simpler SELECT if persistent\n    out, err = source.RunSQL(ctx, simplifiedStmt, params)\n}\nif err != nil { return err }","preventionTips":["Avoid exotic column types in result sets; CAST when needed","Keep the MySQL driver and toolbox up to date","Verify server version compatibility","Check network intermediaries for truncation"],"tags":["singlestore","sql","resultset","types"],"backgroundTag":"sql-result-metadata-failure","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"}