Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6555899

Browse files
committed
Remove recently added PL/Perl encoding tests
These only pass cleanly on UTF8 and SQL_ASCII encodings, besides theJapanese encoding in which they were originally written, which is clearlynot good enough. Since the functionality they test has not ever beentested from PL/Perl, the best answer seems to be to remove the new testscompletely.Per buildfarm results and ensuing discussion.
1 parent57b9bdd commit6555899

File tree

3 files changed

+0
-70
lines changed

3 files changed

+0
-70
lines changed

‎src/pl/plperl/expected/plperl_lc.out

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,3 @@ $$ LANGUAGE plperl;
88
SELECT perl_zerob();
99
ERROR: invalid byte sequence for encoding "UTF8": 0x00
1010
CONTEXT: PL/Perl function "perl_zerob"
11-
CREATE OR REPLACE FUNCTION perl_0x80_in(text) RETURNS BOOL AS $$
12-
return ($_[0] eq "abc\x80de" ? "true" : "false");
13-
$$ LANGUAGE plperl;
14-
SELECT perl_0x80_in(E'abc\x80de');
15-
ERROR: invalid byte sequence for encoding "UTF8": 0x80
16-
CREATE OR REPLACE FUNCTION perl_0x80_out() RETURNS TEXT AS $$
17-
return "abc\x80de";
18-
$$ LANGUAGE plperl;
19-
SELECT perl_0x80_out() = E'abc\x80de';
20-
ERROR: invalid byte sequence for encoding "UTF8": 0x80
21-
CREATE OR REPLACE FUNCTION perl_utf_inout(text) RETURNS TEXT AS $$
22-
$str = $_[0]; $code = "NotUTF8:"; $match = "ab\xe5\xb1\xb1cd";
23-
if (utf8::is_utf8($str)) {
24-
$code = "UTF8:"; utf8::decode($str); $match="ab\x{5c71}cd";
25-
}
26-
return ($str ne $match ? $code."DIFFER" : $code."ab\x{5ddd}cd");
27-
$$ LANGUAGE plperl;
28-
SELECT encode(perl_utf_inout(E'ab\xe5\xb1\xb1cd')::bytea, 'escape')
29-
encode
30-
-----------------------
31-
UTF8:ab\345\267\235cd
32-
(1 row)
33-

‎src/pl/plperl/expected/plperl_lc_1.out

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,3 @@ $$ LANGUAGE plperl;
88
SELECT perl_zerob();
99
ERROR: invalid byte sequence for encoding "SQL_ASCII": 0x00
1010
CONTEXT: PL/Perl function "perl_zerob"
11-
CREATE OR REPLACE FUNCTION perl_0x80_in(text) RETURNS BOOL AS $$
12-
return ($_[0] eq "abc\x80de" ? "true" : "false");
13-
$$ LANGUAGE plperl;
14-
SELECT perl_0x80_in(E'abc\x80de');
15-
perl_0x80_in
16-
--------------
17-
t
18-
(1 row)
19-
20-
CREATE OR REPLACE FUNCTION perl_0x80_out() RETURNS TEXT AS $$
21-
return "abc\x80de";
22-
$$ LANGUAGE plperl;
23-
SELECT perl_0x80_out() = E'abc\x80de';
24-
?column?
25-
----------
26-
t
27-
(1 row)
28-
29-
CREATE OR REPLACE FUNCTION perl_utf_inout(text) RETURNS TEXT AS $$
30-
$str = $_[0]; $code = "NotUTF8:"; $match = "ab\xe5\xb1\xb1cd";
31-
if (utf8::is_utf8($str)) {
32-
$code = "UTF8:"; utf8::decode($str); $match="ab\x{5c71}cd";
33-
}
34-
return ($str ne $match ? $code."DIFFER" : $code."ab\x{5ddd}cd");
35-
$$ LANGUAGE plperl;
36-
SELECT encode(perl_utf_inout(E'ab\xe5\xb1\xb1cd')::bytea, 'escape')
37-
encode
38-
--------------------------
39-
NotUTF8:ab\345\267\235cd
40-
(1 row)
41-

‎src/pl/plperl/sql/plperl_lc.sql

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,3 @@ CREATE OR REPLACE FUNCTION perl_zerob() RETURNS TEXT AS $$
66
return"abcd\0efg";
77
$$ LANGUAGE plperl;
88
SELECT perl_zerob();
9-
CREATE OR REPLACEFUNCTIONperl_0x80_in(text) RETURNS BOOLAS $$
10-
return ($_[0] eq"abc\x80de" ?"true" :"false");
11-
$$ LANGUAGE plperl;
12-
SELECT perl_0x80_in(E'abc\x80de');
13-
CREATE OR REPLACEFUNCTIONperl_0x80_out() RETURNSTEXTAS $$
14-
return"abc\x80de";
15-
$$ LANGUAGE plperl;
16-
SELECT perl_0x80_out()= E'abc\x80de';
17-
CREATE OR REPLACEFUNCTIONperl_utf_inout(text) RETURNSTEXTAS $$
18-
$str= $_[0]; $code="NotUTF8:"; $match="ab\xe5\xb1\xb1cd";
19-
if (utf8::is_utf8($str)) {
20-
$code="UTF8:"; utf8::decode($str); $match="ab\x{5c71}cd";
21-
}
22-
return ($str ne $match ? $code."DIFFER" : $code."ab\x{5ddd}cd");
23-
$$ LANGUAGE plperl;
24-
SELECT encode(perl_utf_inout(E'ab\xe5\xb1\xb1cd')::bytea,'escape')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp