Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3342

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/42/3342/1

pgsql-sdbc: set tablename even if we do not know the schema

Change-Id: I74c04e1262cc413696a12aca9af603beded7b07f
---
M connectivity/source/drivers/postgresql/pq_statement.cxx
M connectivity/source/drivers/postgresql/pq_tools.cxx
2 files changed, 13 insertions(+), 3 deletions(-)



diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx 
b/connectivity/source/drivers/postgresql/pq_statement.cxx
index 7304b15..edf7dc3 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -654,7 +654,7 @@
             }
 
         }
-        else if( sourceTable.getLength() && -1 != sourceTable.indexOf( '.' ) )
+        else if( sourceTable.getLength() > 0)
         {
             splitConcatenatedIdentifier( sourceTable, &schema, &table );
         }
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx 
b/connectivity/source/drivers/postgresql/pq_tools.cxx
index 84d9741..86872a7 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -673,10 +673,20 @@
 {
     OStringVector vec;
     tokenizeSQL( rtl::OUStringToOString( source, RTL_TEXTENCODING_UTF8 ), vec );
-    if( vec.size() == 3 )
+    switch (vec.size())
     {
-        *first = rtl::OStringToOUString( vec[0] , RTL_TEXTENCODING_UTF8 );
+    case 1:
+        *first  = OUString();
+        *second = rtl::OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 );
+        break;
+    case 3:
+        *first  = rtl::OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 );
         *second = rtl::OStringToOUString( vec[2], RTL_TEXTENCODING_UTF8 );
+        break;
+    default:
+         SAL_WARN("connectivity.drivers.postgresql",
+                  "pq_tools::splitConcatenatedIdentifier unexpected number of tokens in 
identifier: "
+                  << vec.size());
     }
 }
 

-- 
To view, visit https://gerrit.libreoffice.org/3342
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74c04e1262cc413696a12aca9af603beded7b07f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Lionel Elie Mamane <lionel@mamane.lu>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.