Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to close sql.Rows #25

Merged
merged 1 commit into from
Feb 13, 2019
Merged

need to close sql.Rows #25

merged 1 commit into from
Feb 13, 2019

Conversation

ryanking
Copy link
Contributor

No description provided.

@ryanking ryanking requested a review from a team as a code owner February 13, 2019 21:05
@@ -139,6 +139,7 @@ func readGrants(db *sql.DB, roleName string) ([]*grant, error) {
stmt := fmt.Sprintf(`SHOW GRANTS OF ROLE "%s"`, roleName)
log.Printf("[DEBUG] stmt %s", stmt)
rows, err := sdb.Queryx(stmt)
defer rows.Close()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if rows.Close() will panic when there's an error

@codecov
Copy link

codecov bot commented Feb 13, 2019

Codecov Report

Merging #25 into master will increase coverage by 0.04%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master     #25      +/-   ##
=========================================
+ Coverage   76.06%   76.1%   +0.04%     
=========================================
  Files          15      15              
  Lines         564     565       +1     
=========================================
+ Hits          429     430       +1     
  Misses         91      91              
  Partials       44      44

@czimergebot czimergebot merged commit a4c8708 into master Feb 13, 2019
@ryanking ryanking mentioned this pull request Sep 9, 2019
czimergebot pushed a commit that referenced this pull request Sep 9, 2019
[fix] close rows objectsWe were failing to close rows objects, leading to leaks and possibly lock-ups.

Fixes #73, #25
@ryanking ryanking deleted the ryanking/rows_close branch August 24, 2020 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants