| 1 |
-- Use ONLY plperlu tests here. For plperl/plerlu combined tests |
| 2 |
-- see plperl_plperlu.sql |
| 3 |
-- This test tests setting on_plperlu_init after loading plperl |
| 4 |
LOAD 'plperl'; |
| 5 |
-- Test plperl.on_plperlu_init gets run |
| 6 |
SET plperl.on_plperlu_init = '$_SHARED{init} = 42'; |
| 7 |
DO $$ warn $_SHARED{init} $$ language plperlu; |
| 8 |
WARNING: 42 at line 1. |
| 9 |
-- |
| 10 |
-- Test compilation of unicode regex - regardless of locale. |
| 11 |
-- This code fails in plain plperl in a non-UTF8 database. |
| 12 |
-- |
| 13 |
CREATE OR REPLACE FUNCTION perl_unicode_regex(text) RETURNS INTEGER AS $$ |
| 14 |
return ($_[0] =~ /\x{263A}|happy/i) ? 1 : 0; # unicode smiley |
| 15 |
$$ LANGUAGE plperlu; |