summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2012-12-05 06:00:52 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2012-12-06 19:20:07 +0100
commit1bb035777d6ba48fdc6e8a0e5d0e1f47e087f322 (patch)
tree247a09839edd1aa0eac92c384a68356561734e6f /connectivity/source/drivers
parent249028838a4f87aa8c8addc4531239171d8016c2 (diff)
Variable-sized datatype -> cannot predict length of needed buffer
Change-Id: I29b8c0352b06fb86e924aaf8108de6835eb9cb89
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/odbcbase/OTools.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index 3e327803513a..90d0791d1cfc 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -41,10 +41,6 @@ size_t sqlTypeLen ( SQLSMALLINT _nType )
{
switch (_nType)
{
- case SQL_C_CHAR:
- return sizeof(SQLCHAR *);
- case SQL_C_WCHAR:
- return sizeof(SQLWCHAR *);
case SQL_C_SSHORT:
case SQL_C_SHORT:
return sizeof(SQLSMALLINT);
@@ -74,10 +70,6 @@ size_t sqlTypeLen ( SQLSMALLINT _nType )
/* UnixODBC gives this the same value as SQL_C_UBIGINT
case SQL_C_BOOKMARK:
return sizeof(BOOKMARK); */
- case SQL_C_BINARY:
- // UnixODBC gives these the same value
- //case SQL_C_VARBOOKMARK:
- return sizeof(SQLCHAR*);
case SQL_C_TYPE_DATE:
case SQL_C_DATE:
return sizeof(SQL_DATE_STRUCT);
@@ -105,6 +97,13 @@ size_t sqlTypeLen ( SQLSMALLINT _nType )
case SQL_C_INTERVAL_HOUR_TO_SECOND:
case SQL_C_INTERVAL_MINUTE_TO_SECOND:
return sizeof(SQL_INTERVAL_STRUCT);
+ // ** Variable-sized datatypes -> cannot predict length
+ case SQL_C_CHAR:
+ case SQL_C_WCHAR:
+ case SQL_C_BINARY:
+ // UnixODBC gives this the same value as SQL_C_BINARY
+ //case SQL_C_VARBOOKMARK:
+ // Unknown datatype -> cannot predict length
default:
return static_cast<size_t>(-1);
}