• Gwenael Treguier's avatar
    database/sql: ensure Stmts are correctly closed. · c3954dd5
    Gwenael Treguier authored
    To make sure that there is no resource leak,
    I suggest to fix the 'fakedb' driver such as it fails when any
    Stmt is not closed.
    First, add a check in fakeConn.Close().
    Then, fix all missing Stmt.Close()/Rows.Close().
    I am not sure that the strategy choose in fakeConn.Prepare/prepare* is ok.
    The weak point in this patch is the change in Tx.Query:
      - Tests pass without this change,
      - I found it by manually analyzing the code,
      - I just try to make Tx.Query look like DB.Query.
    
    R=golang-dev, bradfitz
    CC=golang-dev
    https://golang.org/cl/5759050
    c3954dd5
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...