Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • G go
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • go
  • Repository
  • go
  • src
  • database
  • sql
  • sql_test.go
Find file BlameHistoryPermalink
  • HaraldNordgren's avatar
    database/sql: include SQL column name in Scan() error message · 8da7706b
    HaraldNordgren authored Jan 07, 2018
    When 'convertAssign' gives an error, instead of giving just the index of
    the failing column -- which is not always helpful, especially when there
    are lots of columns in the query -- utilize 'rs.rowsi.Columns()' to
    extract the underlying column name and include that in the error string:
    
        sql: Scan error on column index 0, name "some_column": ...
    
    Fixes #23362
    
    Change-Id: I0fe71ff3c25f4c0dd9fc6aa2c2da2360dd93e3e0
    Reviewed-on: https://go-review.googlesource.com/86537
    
    
    Reviewed-by: default avatarHarald Nordgren <haraldnordgren@gmail.com>
    Reviewed-by: default avatarDaniel Theophanes <kardianos@gmail.com>
    Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    8da7706b
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7