8000 db, bugfix: the db connection in odbc was not closed properly before … · fibjs/fibjs@d3969df · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit d3969df

Browse files
committed
db, bugfix: the db connection in odbc was not closed properly before being released.
1 parent 90e483b commit d3969df

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

fibjs/src/db/odbc/Odbc.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ result_t db_base::openOdbc(exlib::string connString, obj_ptr<DbConnection_base>&
4343

4444
result_t odbc_disconnect(void* conn)
4545
{
46-
if (conn)
46+
if (conn) {
47+
SQLDisconnect(conn);
4748
SQLFreeConnect(conn);
49+
}
4850

4951
return 0;
5052
}

fibjs/src/db/odbc/dl_odbc.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ SQLRETURN SQL_API SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd,
5757
szConnStrOut, cbConnStrOutMax, pcbConnStrOut, fDriverCompletion);
5858
}
5959

60+
SQLRETURN SQL_API SQLDisconnect(SQLHDBC hdbc)
61+
{
62+
odbc_func(SQLDisconnect);
63+
return s_SQLDisconnect(hdbc);
64+
}
65+
6066
SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR* StatementText, SQLINTEGER TextLength)
6167
{
6268
odbc_func(SQLPrepare);

0 commit comments

Comments
 (0)
0