{
  "id": "go/sql-rows-scan-type-mismatch",
  "signature": "error: sql: Scan error on column index 1, name \"age\": converting driver.Value type int64 (\"25\") to a uint8: invalid syntax",
  "signature_zh": "error: sql: 扫描第1列（age）时出错：无法将 driver.Value 类型 int64 转换为 uint8",
  "regex": "error:\\ sql:\\ Scan\\ error\\ on\\ column\\ index\\ 1,\\ name\\ \"age\":\\ converting\\ driver\\.Value\\ type\\ int64\\ \\(\"25\"\\)\\ to\\ a\\ uint8:\\ invalid\\ syntax",
  "domain": "go",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "数据库返回 int64 类型，但目标变量声明为 uint8，导致类型转换失败。",
  "root_cause_type": "generic",
  "root_cause_zh": "查询结果列类型与 Go 变量声明不匹配，database/sql 在扫描时无法进行窄类型转换。",
  "versions": [
    {
      "version": "1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "database/sql 内部处理类型转换，断言无效且可能 panic",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "数据错误被静默忽略，导致业务逻辑使用错误数据",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "将目标变量改为 int64 或 sql.NullInt64",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "在 SQL 查询中使用 CAST(age AS UNSIGNED) 预转换",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}