Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c574106

Browse files
committed
Adjust plpython for escape_string_warning.
1 parent bc0be35 commit c574106

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/pl/plpython/expected/plpython_function.out

+4-4
Original file line numberDiff line numberDiff line change
@@ -270,21 +270,21 @@ LANGUAGE plpythonu;
270270
--
271271
-- Unicode error handling
272272
--
273-
CREATE FUNCTION unicode_return_error() RETURNS text AS '
273+
CREATE FUNCTION unicode_return_error() RETURNS text AS E'
274274
return u"\\x80"
275275
' LANGUAGE plpythonu;
276-
CREATE FUNCTION unicode_trigger_error() RETURNS trigger AS '
276+
CREATE FUNCTION unicode_trigger_error() RETURNS trigger AS E'
277277
TD["new"]["testvalue"] = u"\\x80"
278278
return "MODIFY"
279279
' LANGUAGE plpythonu;
280280
CREATE TRIGGER unicode_test_bi BEFORE INSERT ON unicode_test
281281
FOR EACH ROW EXECUTE PROCEDURE unicode_trigger_error();
282-
CREATE FUNCTION unicode_plan_error1() RETURNS text AS '
282+
CREATE FUNCTION unicode_plan_error1() RETURNS text AS E'
283283
plan = plpy.prepare("SELECT $1 AS testvalue", ["text"])
284284
rv = plpy.execute(plan, [u"\\x80"], 1)
285285
return rv[0]["testvalue"]
286286
' LANGUAGE plpythonu;
287-
CREATE FUNCTION unicode_plan_error2() RETURNS text AS '
287+
CREATE FUNCTION unicode_plan_error2() RETURNS text AS E'
288288
plan = plpy.prepare("SELECT $1 AS testvalue1, $2 AS testvalue2", ["text", "text"])
289289
rv = plpy.execute(plan, u"\\x80", 1)
290290
return rv[0]["testvalue1"]

src/pl/plpython/sql/plpython_function.sql

+4-4
Original file line numberDiff line numberDiff line change
@@ -318,25 +318,25 @@ LANGUAGE plpythonu;
318318
-- Unicode error handling
319319
--
320320

321-
CREATE FUNCTION unicode_return_error() RETURNS text AS '
321+
CREATE FUNCTION unicode_return_error() RETURNS text AS E'
322322
return u"\\x80"
323323
' LANGUAGE plpythonu;
324324

325-
CREATE FUNCTION unicode_trigger_error() RETURNS trigger AS '
325+
CREATE FUNCTION unicode_trigger_error() RETURNS trigger AS E'
326326
TD["new"]["testvalue"] = u"\\x80"
327327
return "MODIFY"
328328
' LANGUAGE plpythonu;
329329

330330
CREATE TRIGGER unicode_test_bi BEFORE INSERT ON unicode_test
331331
FOR EACH ROW EXECUTE PROCEDURE unicode_trigger_error();
332332

333-
CREATE FUNCTION unicode_plan_error1() RETURNS text AS '
333+
CREATE FUNCTION unicode_plan_error1() RETURNS text AS E'
334334
plan = plpy.prepare("SELECT $1 AS testvalue", ["text"])
335335
rv = plpy.execute(plan, [u"\\x80"], 1)
336336
return rv[0]["testvalue"]
337337
' LANGUAGE plpythonu;
338338

339-
CREATE FUNCTION unicode_plan_error2() RETURNS text AS '
339+
CREATE FUNCTION unicode_plan_error2() RETURNS text AS E'
340340
plan = plpy.prepare("SELECT $1 AS testvalue1, $2 AS testvalue2", ["text", "text"])
341341
rv = plpy.execute(plan, u"\\x80", 1)
342342
return rv[0]["testvalue1"]

0 commit comments

Comments
 (0)