Kaydet (Commit) 4b3a1d24 authored tarafından Tamas Bunth's avatar Tamas Bunth Kaydeden (comit) Xisco Faulí

mysqlc: Add support for mysql type INT24

Which is mapped to sal_Int32.

Change-Id: Ibf12e92a20034440fa990ed0c6f1196f4ca3f40f
Reviewed-on: https://gerrit.libreoffice.org/73217
Tested-by: Jenkins
Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
(cherry picked from commit 3a4c4482)
Reviewed-on: https://gerrit.libreoffice.org/73459Reviewed-by: 's avatarXisco Faulí <xiscofauli@libreoffice.org>
üst 595d28ab
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <com/sun/star/sdbcx/CompareBookmark.hpp> #include <com/sun/star/sdbcx/CompareBookmark.hpp>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx> #include <cppuhelper/typeprovider.hxx>
#include <sal/log.hxx>
using namespace rtl; using namespace rtl;
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
...@@ -66,6 +67,7 @@ const std::type_index getTypeFromMysqlType(enum_field_types type) ...@@ -66,6 +67,7 @@ const std::type_index getTypeFromMysqlType(enum_field_types type)
case MYSQL_TYPE_SHORT: case MYSQL_TYPE_SHORT:
return std::type_index(typeid(sal_Int16)); return std::type_index(typeid(sal_Int16));
case MYSQL_TYPE_LONG: case MYSQL_TYPE_LONG:
case MYSQL_TYPE_INT24:
return std::type_index(typeid(sal_Int32)); return std::type_index(typeid(sal_Int32));
case MYSQL_TYPE_LONGLONG: case MYSQL_TYPE_LONGLONG:
return std::type_index(typeid(sal_Int64)); return std::type_index(typeid(sal_Int64));
...@@ -88,7 +90,6 @@ const std::type_index getTypeFromMysqlType(enum_field_types type) ...@@ -88,7 +90,6 @@ const std::type_index getTypeFromMysqlType(enum_field_types type)
case MYSQL_TYPE_BLOB: case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_YEAR: case MYSQL_TYPE_YEAR:
case MYSQL_TYPE_BIT: case MYSQL_TYPE_BIT:
case MYSQL_TYPE_INT24:
case MYSQL_TYPE_SET: case MYSQL_TYPE_SET:
case MYSQL_TYPE_ENUM: case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_GEOMETRY: case MYSQL_TYPE_GEOMETRY:
...@@ -266,6 +267,7 @@ ORowSetValue OPreparedResultSet::getRowSetValue(sal_Int32 nColumnIndex) ...@@ -266,6 +267,7 @@ ORowSetValue OPreparedResultSet::getRowSetValue(sal_Int32 nColumnIndex)
case MYSQL_TYPE_SHORT: case MYSQL_TYPE_SHORT:
return getShort(nColumnIndex); return getShort(nColumnIndex);
case MYSQL_TYPE_LONG: case MYSQL_TYPE_LONG:
case MYSQL_TYPE_INT24:
return getInt(nColumnIndex); return getInt(nColumnIndex);
case MYSQL_TYPE_LONGLONG: case MYSQL_TYPE_LONGLONG:
return getLong(nColumnIndex); return getLong(nColumnIndex);
...@@ -285,9 +287,10 @@ ORowSetValue OPreparedResultSet::getRowSetValue(sal_Int32 nColumnIndex) ...@@ -285,9 +287,10 @@ ORowSetValue OPreparedResultSet::getRowSetValue(sal_Int32 nColumnIndex)
case MYSQL_TYPE_NEWDECIMAL: case MYSQL_TYPE_NEWDECIMAL:
return getString(nColumnIndex); return getString(nColumnIndex);
default: default:
mysqlc_sdbc_driver::throwFeatureNotImplementedException( SAL_WARN("connectivity.mysqlc", "OPreparedResultSet::getRowSetValue: unknown type: "
"OPreparedResultSet::getRowSetValue", *this); << m_aFields[nColumnIndex - 1].type);
return ORowSetValue(); throw SQLException("Unknown column type when fetching result", *this, OUString(), 1,
Any());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment