summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2016-11-12 01:11:42 +0100
committerJulien Nabet <serval2412@yahoo.fr>2016-11-12 09:15:49 +0000
commita2c6112a4753347070608480be21066b6dab0bc7 (patch)
treeb648fc435a3cf7e3c240563fe286b274549995d9
parent045dee9c5e884ce16a2fa93354a4ae912137ae46 (diff)
Related tdf#70433: Use subtype to distinguish BLOB/CLOB for Firebird
See http://www.firebirdfaq.org/faq48/ Change-Id: If233919daeb02b67d0b3bc42547fbd3030864c37 Reviewed-on: https://gerrit.libreoffice.org/30789 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--connectivity/source/drivers/firebird/Util.cxx12
-rw-r--r--connectivity/source/drivers/firebird/Util.hxx8
2 files changed, 19 insertions, 1 deletions
diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index 318aa6d839b0..114c4c811bd9 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -100,7 +100,17 @@ sal_Int32 firebird::getColumnTypeFromFBType(short aType, short aSubType)
case SQL_TIMESTAMP:
return DataType::TIMESTAMP;
case SQL_BLOB:
- return DataType::BLOB;
+ switch (static_cast<BlobSubtype>(aSubType))
+ {
+ case BlobSubtype::Blob:
+ return DataType::BLOB;
+ case BlobSubtype::Clob:
+ return DataType::CLOB;
+ default:
+ SAL_WARN("connectivity.firebird", "Unknown subtype for Blob type: " << aSubType);
+ assert(!"Unknown subtype for Blob type"); // Should never happen
+ return 0;
+ }
case SQL_ARRAY:
return DataType::ARRAY;
case SQL_TYPE_TIME:
diff --git a/connectivity/source/drivers/firebird/Util.hxx b/connectivity/source/drivers/firebird/Util.hxx
index fa9af07c0b27..e8077e65596a 100644
--- a/connectivity/source/drivers/firebird/Util.hxx
+++ b/connectivity/source/drivers/firebird/Util.hxx
@@ -25,6 +25,14 @@ namespace connectivity
namespace firebird
{
typedef ::std::vector< OString > OStringVector;
+ // Type Blob has 2 subtypes values
+ // 0 for BLOB, 1 for CLOB
+ // see http://www.firebirdfaq.org/faq48/
+ enum class BlobSubtype {
+ Blob = 0,
+ Clob = 1
+ };
+
/**
* Make sure an identifier is safe to use within the databse. Currently
* firebird seems to return identifiers with 93 character (instead of