From 08810b77f44975536bb2658c9886fed6d5742237 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Tue, 27 Mar 2012 12:48:31 -0400 Subject: [PATCH] We use plperlu, not plperl. So don't load both! Signed-off-by: Thomas Berezansky Signed-off-by: Jason Stephenson --- Open-ILS/src/sql/Pg/900.audit-functions.sql | 6 +++--- Open-ILS/src/sql/Pg/create_database.sql | 2 +- Open-ILS/src/sql/Pg/create_database_9_1.sql | 2 +- Open-ILS/src/sql/Pg/upgrade/XXXX.no_plperl.sql | 17 +++++++++++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.no_plperl.sql diff --git a/Open-ILS/src/sql/Pg/900.audit-functions.sql b/Open-ILS/src/sql/Pg/900.audit-functions.sql index 6c0dc3ff13..5e1239e2f3 100644 --- a/Open-ILS/src/sql/Pg/900.audit-functions.sql +++ b/Open-ILS/src/sql/Pg/900.audit-functions.sql @@ -28,18 +28,18 @@ CREATE SCHEMA auditor; CREATE OR REPLACE FUNCTION auditor.set_audit_info(INT, INT) RETURNS VOID AS $$ $_SHARED{"eg_audit_user"} = $_[0]; $_SHARED{"eg_audit_ws"} = $_[1]; -$$ LANGUAGE plperl; +$$ LANGUAGE plperlu; -- Get the User AND workstation in one call. Less calls, useful for joins ;) CREATE OR REPLACE FUNCTION auditor.get_audit_info() RETURNS TABLE (eg_user INT, eg_ws INT) AS $$ return [{eg_user => $_SHARED{"eg_audit_user"}, eg_ws => $_SHARED{"eg_audit_ws"}}]; -$$ LANGUAGE plperl; +$$ LANGUAGE plperlu; -- Clear the audit info, for whatever reason CREATE OR REPLACE FUNCTION auditor.clear_audit_info() RETURNS VOID AS $$ delete($_SHARED{"eg_audit_user"}); delete($_SHARED{"eg_audit_ws"}); -$$ LANGUAGE plperl; +$$ LANGUAGE plperlu; CREATE FUNCTION auditor.create_auditor_seq ( sch TEXT, tbl TEXT ) RETURNS BOOL AS $creator$ BEGIN diff --git a/Open-ILS/src/sql/Pg/create_database.sql b/Open-ILS/src/sql/Pg/create_database.sql index b3be0f0da0..aec933e708 100644 --- a/Open-ILS/src/sql/Pg/create_database.sql +++ b/Open-ILS/src/sql/Pg/create_database.sql @@ -14,7 +14,7 @@ CREATE DATABASE :db_name TEMPLATE template0 ENCODING 'UNICODE' LC_COLLATE 'C' LC \connect :db_name -CREATE LANGUAGE plperl; +--CREATE LANGUAGE plperl; CREATE LANGUAGE plperlu; -- This dance is because :variable/blah doesn't seem to work when doing \i diff --git a/Open-ILS/src/sql/Pg/create_database_9_1.sql b/Open-ILS/src/sql/Pg/create_database_9_1.sql index 97739f9a11..dd6066fbbf 100644 --- a/Open-ILS/src/sql/Pg/create_database_9_1.sql +++ b/Open-ILS/src/sql/Pg/create_database_9_1.sql @@ -14,7 +14,7 @@ CREATE DATABASE :db_name TEMPLATE template0 ENCODING 'UNICODE' LC_COLLATE 'C' LC \connect :db_name -CREATE LANGUAGE plperl; +--CREATE LANGUAGE plperl; CREATE LANGUAGE plperlu; CREATE EXTENSION tablefunc; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.no_plperl.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.no_plperl.sql new file mode 100644 index 0000000000..c2157db81f --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.no_plperl.sql @@ -0,0 +1,17 @@ + +-- Re-create these as plperlu instead of plperl +CREATE OR REPLACE FUNCTION auditor.set_audit_info(INT, INT) RETURNS VOID AS $$ + $_SHARED{"eg_audit_user"} = $_[0]; + $_SHARED{"eg_audit_ws"} = $_[1]; +$$ LANGUAGE plperlu; + +CREATE OR REPLACE FUNCTION auditor.get_audit_info() RETURNS TABLE (eg_user INT, eg_ws INT) AS $$ + return [{eg_user => $_SHARED{"eg_audit_user"}, eg_ws => $_SHARED{"eg_audit_ws"}}]; +$$ LANGUAGE plperlu; + +CREATE OR REPLACE FUNCTION auditor.clear_audit_info() RETURNS VOID AS $$ + delete($_SHARED{"eg_audit_user"}); + delete($_SHARED{"eg_audit_ws"}); +$$ LANGUAGE plperlu; + +DROP LANGUAGE plperl; -- 2.11.0