Fix regression tests.

warn_grant
Hadi Moshayedi 2019-03-22 12:10:46 -07:00 committed by Philip Dubé
parent 6094b830de
commit 72858579b0
4 changed files with 12 additions and 0 deletions

View File

@ -13,14 +13,21 @@
#include "catalog/namespace.h"
#include "distributed/commands.h"
#include "distributed/metadata_cache.h"
#include "distributed/master_protocol.h"
/* placeholder for PreprocessGrantStmt */
List *
PreprocessGrantStmt(Node *node, const char *queryString)
{
GrantStmt *grantStmt = castNode(GrantStmt, node);
bool showPropagationWarning = false;
/* don't emit warnings in worker nodes */
if (!IsCoordinator())
{
return NIL;
}
if (grantStmt->targtype == ACL_TARGET_ALL_IN_SCHEMA)
{

View File

@ -2408,6 +2408,7 @@ CREATE USER router_user;
NOTICE: not propagating CREATE ROLE/USER commands to worker nodes
HINT: Connect to worker nodes directly to manually create all necessary users and roles.
GRANT INSERT ON ALL TABLES IN SCHEMA public TO router_user;
WARNING: not propagating GRANT command to worker nodes
\c - router_user - :master_port
-- first test that it is marked invalid inside a transaction block
-- we will fail to connect to worker 2, since the user does not exist

View File

@ -1240,6 +1240,9 @@ PL/pgSQL function run_command_on_coordinator_and_workers(text) line 3 at EXECUTE
(1 row)
SELECT run_command_on_coordinator_and_workers('GRANT ALL ON DATABASE postgres to "test-user"');
WARNING: not propagating GRANT command to worker nodes
CONTEXT: SQL statement "GRANT ALL ON DATABASE postgres to "test-user""
PL/pgSQL function run_command_on_coordinator_and_workers(text) line 3 at EXECUTE
run_command_on_coordinator_and_workers
---------------------------------------------------------------------

View File

@ -689,6 +689,7 @@ CREATE USER try_drop_table WITH LOGIN;
NOTICE: not propagating CREATE ROLE/USER commands to worker nodes
HINT: Connect to worker nodes directly to manually create all necessary users and roles.
GRANT ALL ON SCHEMA public TO try_drop_table;
WARNING: not propagating GRANT command to worker nodes
SELECT run_command_on_workers('CREATE USER try_drop_table WITH LOGIN');
run_command_on_workers
---------------------------------------------------------------------