Closing open connection.
This commit is contained in:
parent
6f04fa3435
commit
a1b413972d
@ -457,8 +457,8 @@ function check_close()
|
|||||||
collectgarbage ()
|
collectgarbage ()
|
||||||
CONN_OK (a.CONN)
|
CONN_OK (a.CONN)
|
||||||
a.cur = cur
|
a.cur = cur
|
||||||
a.cur:close()
|
a.cur:close()
|
||||||
a.CONN:close()
|
a.CONN:close()
|
||||||
cur = nil
|
cur = nil
|
||||||
collectgarbage ()
|
collectgarbage ()
|
||||||
assert2(nil, a.cur, "cursor not collected")
|
assert2(nil, a.cur, "cursor not collected")
|
||||||
@ -473,13 +473,14 @@ function check_close()
|
|||||||
CUR_OK (cur)
|
CUR_OK (cur)
|
||||||
assert (cur:fetch(), "corrupted cursor")
|
assert (cur:fetch(), "corrupted cursor")
|
||||||
cur:close ()
|
cur:close ()
|
||||||
|
conn:close ()
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function drop_table ()
|
function drop_table ()
|
||||||
-- Postgres retorna 0, enquanto ODBC retorna -1.
|
-- Postgres retorna 0, enquanto ODBC retorna -1.
|
||||||
CONN:setautocommit(true)
|
CONN:setautocommit(true)
|
||||||
assert (CONN:execute ("drop table t"))
|
assert (CONN:execute ("drop table t"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user