|
|
Choosing A Webhost: |
CVS update of libmysequoia/src (CarobStmt.cpp): msg#00060db.carob.cvs
Date: Tuesday, February 21, 2006 @ 11:04:24 Author: zsolt Path: /cvsroot/carob/libmysequoia/src Modified: CarobStmt.cpp (1.22 -> 1.23) Because MySQL JDBC client will convert unsigned type to a bigger type, we need to use getAsXXX and not getXXX when fetching values. This is safe. ---------------+ CarobStmt.cpp | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) Index: libmysequoia/src/CarobStmt.cpp diff -u libmysequoia/src/CarobStmt.cpp:1.22 libmysequoia/src/CarobStmt.cpp:1.23 --- libmysequoia/src/CarobStmt.cpp:1.22 Mon Feb 13 13:45:20 2006 +++ libmysequoia/src/CarobStmt.cpp Tue Feb 21 11:04:24 2006 @@ -400,6 +400,7 @@ fPtr->max_length = 0; break; default: + LOG4CXX_ERROR(logger, "bind_result: unsupported type pno=" << no << " type=" << p->buffer_type); set_error(CR_UNSUPPORTED_PARAM_TYPE, SQLT_UNKNOWN); result = true; } @@ -731,10 +732,14 @@ result = new short(liveResultSet->getInt32(colNo)); break; case MYSQL_TYPE_LONG: - result = new int(liveResultSet->getInt32(colNo)); + //we need to use getAsInt and not getInt32 because mysql java client will convert the + //unsigned integer to long + result = new int(liveResultSet->getAsInt(colNo)); break; case MYSQL_TYPE_LONGLONG: - result = new int64_t(liveResultSet->getInt64(colNo)); + //we need to use getAsInt64 and not getInt64 because mysql java client will convert the + //unsigned long to bigint + result = new int64_t(liveResultSet->getAsInt64(colNo)); break; case MYSQL_TYPE_FLOAT: result = new float(liveResultSet->getFloat(colNo)); @@ -774,7 +779,11 @@ catch (NullValueException) { } - + catch (CarobException &e) + { + set_error(e.getErrorCode(), toString(e.description()).c_str(), toString(e.getSQLState()).c_str()); + } + LOG4CXX_DEBUG(logger, "Leaving alloc_fetch_field: result=" << result); return result; }
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS update of carob (2 files), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
|---|---|
| Next by Date: | CVS update of libmysequoia/src (MySQLAPI.cpp), zsolt-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Previous by Thread: | CVS update of libmysequoia/src (CarobStmt.cpp), zsolt-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Next by Thread: | CVS update of libmysequoia/src (CarobStmt.cpp), zsolt-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.
|