dbaccess/source/core/dataaccess/connection.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit bf0374b64edac86402e295a38f0faa655d91abc6
Author:     Julien Nabet <[email protected]>
AuthorDate: Sat Nov 9 12:47:43 2024 +0100
Commit:     Julien Nabet <[email protected]>
CommitDate: Fri Nov 15 16:56:43 2024 +0100

    tdf#130564: getTableTypes retrieves only table types of the current database
    
    So indicate to LO that at least PostgreSQL and MySQL/MariaDB support views
    
    Change-Id: I241fa3cfc599e11c1f1523a78a1905beadc80307
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176308
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <[email protected]>

diff --git a/dbaccess/source/core/dataaccess/connection.cxx 
b/dbaccess/source/core/dataaccess/connection.cxx
index 982303889a82..d1543a36c036 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -316,6 +316,16 @@ OConnection::OConnection(ODatabaseSource& _rDB
                     }
                 }
             }
+            // tdf#130564: getTableTypes retrieves only the table types of the 
current database and not all the possible table types
+            // provided by the DBMS. JDBC would need a new function, something 
like "supportsViews()"
+            // do the same for MySQL/MariaDB since we're on it
+            OUString strDbProductName = xMeta->getDatabaseProductName();
+            if (!m_bSupportsViews && xMeta->getURL().startsWith("sdbc:odbc:") 
&&
+                 (strDbProductName == "PostgreSQL" || strDbProductName == 
"MySQL")
+               )
+            {
+                m_bSupportsViews = true;
+            }
             // some dbs don't support this type so we should ask if a 
XViewsSupplier is supported
             if(!m_bSupportsViews)
             {

Reply via email to