Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

CVS update of libmysequoia/src (CarobStmt.cpp): msg#00060

db.carob.cvs

Subject: CVS update of libmysequoia/src (CarobStmt.cpp)

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>
Google Custom Search

Free Magazines

Cisco News
Receive 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

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo