summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2012-02-27 13:47:24 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2012-02-27 13:48:50 +0100
commitfdd70e63eee34e762f5e4c2568affd35b6bc68af (patch)
treebd8f31ac642a139b4fe04105eac1d411210fdc66
parent15547450bdba10959473c2cb5891f29ad5053b09 (diff)
fdo#46675: fixup
-rw-r--r--connectivity/source/drivers/postgresql/pq_databasemetadata.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
index d925cb166e88..b0b5d1a9d74e 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() );