[Libreoffice-commits] core.git: connectivity/source

Julien Nabet serval2412 at yahoo.fr
Sat Nov 12 09:16:15 UTC 2016


 connectivity/source/drivers/firebird/Util.cxx |   12 +++++++++++-
 connectivity/source/drivers/firebird/Util.hxx |    8 ++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit a2c6112a4753347070608480be21066b6dab0bc7
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Nov 12 01:11:42 2016 +0100

    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 at yahoo.fr>
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index 318aa6d..114c4c8 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 fa9af07..e8077e6 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


More information about the Libreoffice-commits mailing list