{"record":{"id":"ea62b7c0116deaf4","repo":"googleapis/mcp-toolbox","slug":"unable-to-retrieve-rows-column-name-w-ea62b7","errorCode":null,"errorMessage":"unable to retrieve rows column name: %w","messagePattern":"unable to retrieve rows column name: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/mindsdb/mindsdb.go","lineNumber":119,"sourceCode":"\nfunc (s *Source) MindsDBPool() *sql.DB {\n\treturn s.Pool\n}\n\nfunc (s *Source) MySQLPool() *sql.DB {\n\treturn s.Pool\n}\n\nfunc (s *Source) RunSQL(ctx context.Context, statement string, params []any) (any, error) {\n\t// MindsDB now supports MySQL prepared statements natively\n\tresults, err := s.MindsDBPool().QueryContext(ctx, statement, params...)\n\tif err != nil {\n\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...)","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/mindsdb/mindsdb.go#L101-L137","documentation":"After a successful query, RunSQL calls results.Columns() to read the result set's column names; failure to access result-set metadata is wrapped as \"unable to retrieve rows column name\". This is rare and usually indicates a broken or already-closed connection/result object rather than a problem with the SQL itself.","triggerScenarios":"results.Columns() returns an error — typically when the underlying MySQL connection was dropped between execution and metadata read, or the driver returned a corrupt/aborted result set.","commonSituations":"MindsDB server restarting mid-query; connection killed by proxy/load-balancer idle timeout; driver bug or protocol desync after a large result set.","solutions":["Retry the query — transient connection drops resolve on re-execute","Check MindsDB server logs for restarts or aborted connections","Ensure no intermediate proxy terminates idle MySQL connections; enable keepalives","Verify driver and server protocol versions are compatible"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"cols, err := results.Columns()\nif err != nil {\n    // transient: close and retry the query once with backoff\n    results.Close()\n    return retryQuery(ctx, statement, params)\n}","preventionTips":["Configure connection pool max-lifetime below proxy idle timeouts","Enable MySQL keepalive settings in the DSN","Monitor MindsDB server restarts"],"tags":["mindsdb","mysql","resultset","metadata"],"backgroundTag":"result-metadata-unavailable","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"}