mirror of https://github.com/postgres/postgres
The latter are only run if the platform can run both interpreters in the same backend.REL9_0_ALPHA4_BRANCH
parent
0346442b5d
commit
510f3502eb
@ -0,0 +1,18 @@ |
|||||||
|
-- test plperl/plperlu interaction |
||||||
|
CREATE OR REPLACE FUNCTION bar() RETURNS integer AS $$ |
||||||
|
#die 'BANG!'; # causes server process to exit(2) |
||||||
|
# alternative - causes server process to exit(255) |
||||||
|
spi_exec_query("invalid sql statement"); |
||||||
|
$$ language plperl; -- plperl or plperlu |
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION foo() RETURNS integer AS $$ |
||||||
|
spi_exec_query("SELECT * FROM bar()"); |
||||||
|
return 1; |
||||||
|
$$ LANGUAGE plperlu; -- must be opposite to language of bar |
||||||
|
|
||||||
|
SELECT * FROM bar(); -- throws exception normally |
||||||
|
ERROR: syntax error at or near "invalid" at line 4. |
||||||
|
CONTEXT: PL/Perl function "bar" |
||||||
|
SELECT * FROM foo(); -- used to cause backend crash |
||||||
|
ERROR: syntax error at or near "invalid" at line 4. at line 2. |
||||||
|
CONTEXT: PL/Perl function "foo" |
@ -0,0 +1,9 @@ |
|||||||
|
-- Use ONLY plperlu tests here. For plperl/plerlu combined tests |
||||||
|
-- see plperl_plperlu.sql |
||||||
|
-- |
||||||
|
-- Test compilation of unicode regex - regardless of locale. |
||||||
|
-- This code fails in plain plperl in a non-UTF8 database. |
||||||
|
-- |
||||||
|
CREATE OR REPLACE FUNCTION perl_unicode_regex(text) RETURNS INTEGER AS $$ |
||||||
|
return ($_[0] =~ /\x{263A}|happy/i) ? 1 : 0; # unicode smiley |
||||||
|
$$ LANGUAGE plperlu; |
@ -0,0 +1,17 @@ |
|||||||
|
-- test plperl/plperlu interaction |
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION bar() RETURNS integer AS $$ |
||||||
|
#die 'BANG!'; # causes server process to exit(2) |
||||||
|
# alternative - causes server process to exit(255) |
||||||
|
spi_exec_query("invalid sql statement"); |
||||||
|
$$ language plperl; -- plperl or plperlu |
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION foo() RETURNS integer AS $$ |
||||||
|
spi_exec_query("SELECT * FROM bar()"); |
||||||
|
return 1; |
||||||
|
$$ LANGUAGE plperlu; -- must be opposite to language of bar |
||||||
|
|
||||||
|
SELECT * FROM bar(); -- throws exception normally |
||||||
|
SELECT * FROM foo(); -- used to cause backend crash |
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@ |
|||||||
|
-- Use ONLY plperlu tests here. For plperl/plerlu combined tests |
||||||
|
-- see plperl_plperlu.sql |
||||||
|
|
||||||
|
-- |
||||||
|
-- Test compilation of unicode regex - regardless of locale. |
||||||
|
-- This code fails in plain plperl in a non-UTF8 database. |
||||||
|
-- |
||||||
|
CREATE OR REPLACE FUNCTION perl_unicode_regex(text) RETURNS INTEGER AS $$ |
||||||
|
return ($_[0] =~ /\x{263A}|happy/i) ? 1 : 0; # unicode smiley |
||||||
|
$$ LANGUAGE plperlu; |
Loading…
Reference in new issue