PlPython bug in 9.0/8.4.4
От | Teodor Sigaev |
---|---|
Тема | PlPython bug in 9.0/8.4.4 |
Дата | |
Msg-id | 4C0E0F50.3080006@sigaev.ru обсуждение исходный текст |
Ответы |
Re: PlPython bug in 9.0/8.4.4
|
Список | pgsql-hackers |
The way to reproduce: CREATE OR REPLACE FUNCTION foobar(a integer[]) RETURNS SETOF int8 AS $$ def getplan(name, query, args): if SD.has_key(name): plpy.warning("Using cached plan %s" % name) return SD[name] plpy.warning("Prepare plan %s" % name); plan = plpy.prepare(query, args) plpy.warning("Plan %s prepared"% name); SD[name] = plan return plan for s in a: userPlan = getplan('fooplan', 'select 1', []); rrr = plpy.execute(plan, []) # variable planisn't defined! ret = s yield ret $$ LANGUAGE 'plpythonu'; On 9.0beta2 (instead of correct message "<type 'exceptions.NameError'>: global name 'plan' is not defined"): postgres=# select foobar('{1,2,3}'); WARNING: Prepare plan fooplan CONTEXT: PL/Python function "foobar" WARNING: PL/Python: plpy.SPIError: unrecognized error in PLy_spi_prepare CONTEXT: PL/Python function "foobar" ERROR: error fetching next item from iterator CONTEXT: PL/Python function "foobar" postgres=# select foobar('{1,2,3}'); server closed the connection unexpectedly This probably means the server terminated abnormally before or whileprocessing the request. The connection to the server was lost. Attempting reset: Failed. !?> Log: TRAP: FailedAssertion("!(edata->elevel == 20)", File: "elog.c", Line: 1280) 8.4.4 haves essentially the same bug. -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/
В списке pgsql-hackers по дате отправления: