Tag: oo_pqsdbc_01
User: jbu     
Date: 2007/01/07 13:51:29

Modified:
   dba/connectivity/source/drivers/postgresql/pq_statement.cxx

Log:
 table and column names now quoted during retrieval of auto values

File Changes:

Directory: /dba/connectivity/source/drivers/postgresql/
=======================================================

File [changed]: pq_statement.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/postgresql/pq_statement.cxx?r1=1.1.2.5&r2=1.1.2.6
Delta lines:  +11 -7
--------------------
--- pq_statement.cxx    7 Jan 2007 13:50:37 -0000       1.1.2.5
+++ pq_statement.cxx    7 Jan 2007 21:51:26 -0000       1.1.2.6
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: pq_statement.cxx,v $
  *
- *  $Revision: 1.1.2.5 $
+ *  $Revision: 1.1.2.6 $
  *
- *  last change: $Author: jbu $ $Date: 2007/01/07 13:50:37 $
+ *  last change: $Author: jbu $ $Date: 2007/01/07 21:51:26 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -770,11 +770,18 @@
 {
     Reference< XResultSet > ret;
     OUString query;
+    OUString schemaName, tableName;
+    splitConcatenatedIdentifier(
+        lastTableInserted, &schemaName, &tableName );
+            
     if( nLastOid && lastTableInserted.getLength() )
     {
         OUStringBuffer buf( 128 );
         buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SELECT * FROM " ) );
-        buf.append( lastTableInserted );
+        if( schemaName.getLength() )
+            bufferQuoteQualifiedIdentifier(buf, schemaName,tableName );
+        else
+            bufferQuoteIdentifier( buf, lastTableInserted );
         buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " WHERE oid = " ) );
         buf.append( nLastOid , 10 );
         query = buf.makeStringAndClear();
@@ -802,16 +809,13 @@
 
         // TODO: make also unqualified tables names work here. Have a look at 
2.8.3. The Schema Search Path
         //       in postgresql doc
-        OUString schemaName, tableName;
-        splitConcatenatedIdentifier(
-            lastTableInserted, &schemaName, &tableName );
         
         Sequence< OUString > keyColumnNames = getPrimaryKeyColumnNames( 
connection, schemaName, tableName );
         if( keyColumnNames.getLength() )
         {
             OUStringBuffer buf( 128 );
             buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SELECT * FROM " ) );
-            buf.append( lastTableInserted );
+            bufferQuoteQualifiedIdentifier(buf, schemaName,tableName );
             buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " WHERE " ) );
             bool additionalCondition = false;
             String2StringMap autoValues;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to