Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset proconfig for functions even when babelfish is installed #2798

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions test/JDBC/expected/BABEL_4982.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
-- psql
CREATE SCHEMA s1
GO

CREATE TABLE s1.babel_4982_t (id VARCHAR(100))
GO



CREATE FUNCTION babel_4982_ddl_trigger()
RETURNS event_trigger AS
$$
BEGIN
INSERT INTO babel_4982_t VALUES (current_setting('search_path'));
END;
$$
SECURITY DEFINER
SET search_path = s1, pg_catalog, pg_temp
LANGUAGE plpgsql;
CREATE EVENT TRIGGER babel_4982_ddl_trigger
ON ddl_command_end
EXECUTE PROCEDURE babel_4982_ddl_trigger();
SELECT set_config('search_path', 'master_dbo, sys, '||current_setting('search_path'), false);
GO
~~START~~
text
master_dbo, sys, "$user", public
~~END~~


SHOW search_path
GO
~~START~~
text
master_dbo, sys, "$user", public
~~END~~


CREATE TABLE babel_4982_t2 (id INT)
GO

SHOW search_path
GO
~~START~~
text
master_dbo, sys, "$user", public
~~END~~


BEGIN
GO

SHOW search_path
GO
~~START~~
text
master_dbo, sys, "$user", public
~~END~~


DROP TABLE babel_4982_t2
GO

SHOW search_path
GO
~~START~~
text
master_dbo, sys, "$user", public
~~END~~


COMMIT
GO

-- two entries since two DDLs after trigger was created
SELECT * FROM s1.babel_4982_t
GO
~~START~~
varchar
s1, pg_catalog, pg_temp
s1, pg_catalog, pg_temp
~~END~~


DROP EVENT TRIGGER babel_4982_ddl_trigger
GO

DROP FUNCTION babel_4982_ddl_trigger
GO

DROP TABLE s1.babel_4982_t
GO

DROP SCHEMA s1
GO
64 changes: 64 additions & 0 deletions test/JDBC/input/BABEL_4982.mix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
-- psql
CREATE SCHEMA s1
GO

CREATE TABLE s1.babel_4982_t (id VARCHAR(100))
GO

CREATE FUNCTION babel_4982_ddl_trigger()
RETURNS event_trigger AS
$$
BEGIN
INSERT INTO babel_4982_t VALUES (current_setting('search_path'));
END;
$$
SECURITY DEFINER
SET search_path = s1, pg_catalog, pg_temp
LANGUAGE plpgsql;

CREATE EVENT TRIGGER babel_4982_ddl_trigger
ON ddl_command_end
EXECUTE PROCEDURE babel_4982_ddl_trigger();

SELECT set_config('search_path', 'master_dbo, sys, '||current_setting('search_path'), false);
GO

SHOW search_path
GO

CREATE TABLE babel_4982_t2 (id INT)
GO

SHOW search_path
GO

BEGIN
GO

SHOW search_path
GO

DROP TABLE babel_4982_t2
GO

SHOW search_path
GO

COMMIT
GO

-- two entries since two DDLs after trigger was created
SELECT * FROM s1.babel_4982_t
GO

DROP EVENT TRIGGER babel_4982_ddl_trigger
GO

DROP FUNCTION babel_4982_ddl_trigger
GO

DROP TABLE s1.babel_4982_t
GO

DROP SCHEMA s1
GO
Loading