connectivity/source/drivers/firebird/DatabaseMetaData.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 13de0ade50bec34be612ba4a3196c2efd9ce3b4e
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Wed Dec 29 18:16:29 2021 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Thu Dec 30 13:21:17 2021 +0100

    tdf#146471: Firebird: impossible to delete an external table
    
    See https://bugs.documentfoundation.org/show_bug.cgi?id=146471#c1
    for full explanations
    
    Change-Id: Ie75669cf951429654ff8e6c28508b9fee2ee03bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127715
    Tested-by: Jenkins
    Reviewed-by: Lionel Mamane <lio...@mamane.lu>
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx 
b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index f63468f0813f..262b6112c5b8 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -1339,8 +1339,10 @@ uno::Reference< XResultSet > SAL_CALL 
ODatabaseMetaData::getTables(
     // TODO: GLOBAL TEMPORARY, LOCAL TEMPORARY, ALIAS, SYNONYM
     if (!types.hasElements() || (types.getLength() == 1 && 
types[0].match(wld)))
     {
+        // from Firebird: src/jrd/constants.h
+        // rel_persistent = 0, rel_view = 1, rel_external = 2
         // All table types? I.e. includes system tables.
-        queryBuf.append("(RDB$RELATION_TYPE = 0 OR RDB$RELATION_TYPE = 1) ");
+        queryBuf.append("(RDB$RELATION_TYPE = 0 OR RDB$RELATION_TYPE = 1 OR 
RDB$RELATION_TYPE = 2) ");
     }
     else
     {
@@ -1406,7 +1408,8 @@ uno::Reference< XResultSet > SAL_CALL 
ODatabaseMetaData::getTables(
             }
             else
             {
-                if (nTableType == 0)
+                // see above about src/jrd/constants.h
+                if (nTableType == 0 || nTableType == 2)
                     sTableType = "TABLE";
             }
 

Reply via email to