• 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
..
driver Loading commit data...
convert.go Loading commit data...
convert_test.go Loading commit data...
doc.txt Loading commit data...
fakedb_test.go Loading commit data...
sql.go Loading commit data...
sql_test.go Loading commit data...