connectivity/source/drivers/postgresql/pq_databasemetadata.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fdd70e63eee34e762f5e4c2568affd35b6bc68af
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Mon Feb 27 13:47:24 2012 +0100

    fdo#46675: fixup

diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx 
b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
index d925cb1..b0b5d1a 100644
--- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
@@ -2096,7 +2096,7 @@ void DatabaseMetaData::init_getPrivs_stmt ()
     sSQL.append( ASCII_STR(
             " ) dp,"
             " (SELECT oid, rolname FROM pg_catalog.pg_roles UNION ALL VALUES 
(0, 'PUBLIC')) pr"
-            " WHERE table_schem LIKE ? AND table_name LIKE ? AND 
pg_has_role(pr.oid, dp.grantee, 'USAGE')"
+            " WHERE table_schem LIKE ? AND table_name LIKE ? AND (dp.grantee = 
'PUBLIC' OR pg_has_role(pr.oid, dp.grantee, 'USAGE'))"
             " ORDER BY table_schem, table_name, privilege" ) );
 
     m_getTablePrivs_stmt = m_origin->prepareStatement( 
sSQL.makeStringAndClear() );
@@ -2126,7 +2126,7 @@ void DatabaseMetaData::init_getPrivs_stmt ()
     sSQL.append( ASCII_STR(
             " ) dp,"
             " (SELECT oid, rolname FROM pg_catalog.pg_roles UNION ALL VALUES 
(0, 'PUBLIC')) pr"
-            " WHERE table_schem = ? AND table_name = ? AND column_name LIKE ? 
AND pg_has_role(pr.oid, dp.grantee, 'USAGE')"
+            " WHERE table_schem = ? AND table_name = ? AND column_name LIKE ? 
AND (dp.grantee = 'PUBLIC' OR pg_has_role(pr.oid, dp.grantee, 'USAGE'))"
             " ORDER BY column_name, privilege" ) );
 
     m_getColumnPrivs_stmt = m_origin->prepareStatement( 
sSQL.makeStringAndClear() );
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to