|
|
Choosing A Webhost: |
CVS update of odbsequoia/src (explicit_type.cpp): msg#00092db.carob.cvs
Date: Friday, February 24, 2006 @ 16:05:31 Author: marc Path: /cvsroot/carob/odbsequoia/src Modified: explicit_type.cpp (1.6 -> 1.7) Implemented SQLFreeHandle (simply calling destructor). Using objectify() instead of static_cast<ODBCItem* > directly. Now objectifying also descriptor handles. Returning SQL_INVALID_HANDLE instead of SQL_ERROR. -------------------+ explicit_type.cpp | 32 ++++++++++++++++++++++---------- 1 files changed, 22 insertions(+), 10 deletions(-) Index: odbsequoia/src/explicit_type.cpp diff -u odbsequoia/src/explicit_type.cpp:1.6 odbsequoia/src/explicit_type.cpp:1.7 --- odbsequoia/src/explicit_type.cpp:1.6 Tue Jan 17 16:36:54 2006 +++ odbsequoia/src/explicit_type.cpp Fri Feb 24 16:05:31 2006 @@ -40,15 +40,13 @@ switch (HandleType) { case SQL_HANDLE_DESC: - return NULL; // TODO - case SQL_HANDLE_ENV: case SQL_HANDLE_DBC: case SQL_HANDLE_STMT: + // We don't expect the driver manager to give us corrupted handles return static_cast<ODBCItem *>(Handle); - default: - return NULL; // TODO: invalid handletype + return NULL; } } @@ -61,7 +59,7 @@ SQLHANDLE * OutputHandle) { if (SQL_HANDLE_ENV != HandleType) - static_cast<ODBCItem *>(InputHandle)->clear_diags(); + objectify(HandleType, InputHandle)->clear_diags(); switch (HandleType) { @@ -81,7 +79,7 @@ return SQL_ERROR; default: - return SQL_ERROR; + return SQL_INVALID_HANDLE; // TODO: need to push_diags sthing? } } @@ -93,11 +91,25 @@ SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) { // "If SQLFreeHandle returns SQL_ERROR, the handle is still valid." - static_cast<ODBCItem *>(Handle)->clear_diags(); + objectify(HandleType, Handle)->clear_diags(); + + switch (HandleType) + { + + case SQL_HANDLE_ENV: + case SQL_HANDLE_DBC: + case SQL_HANDLE_STMT: + delete objectify(HandleType, Handle); + return SQL_SUCCESS; + + case SQL_HANDLE_DESC: + // we don't support user allocated descriptors yet + // TODO: push_diags(HY017) + return SQL_ERROR; - SQLRETURN ret = SQL_SUCCESS; - // FIXME: leaking - return ret; + default: + return SQL_INVALID_HANDLE; + } } SQLRETURN
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS update of odbsequoia/src (5 files), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
|---|---|
| Next by Date: | CVS update of odbsequoia/src (stmt.cpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Previous by Thread: | CVS update of odbsequoia/src (5 files), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Next by Thread: | CVS update of odbsequoia/src (stmt.cpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|