• 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
..
cmd Loading commit data...
lib9 Loading commit data...
libbio Loading commit data...
libmach Loading commit data...
pkg Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
sudo.bash Loading commit data...