Re: BUG #6379: SQL Function Causes Back-end Crash - Mailing list pgsql-bugs

From Pavel Stehule
Subject Re: BUG #6379: SQL Function Causes Back-end Crash
Date
Msg-id CAFj8pRBN1gaSKC7VS=rZZ8uWE30MaLD5c=mc=1zBmDNWzhVJmQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #6379: SQL Function Causes Back-end Crash  (Paul Ramsey <pramsey@cleverelephant.ca>)
List pgsql-bugs
2012/1/4 Paul Ramsey <pramsey@cleverelephant.ca>:
> One extra detail, my PostgreSQL is compiled with --enable-cassert.
> This seems to be what sets off the killer function.

me too

Pavel


>
> On Wed, Jan 4, 2012 at 11:25 AM, hubert depesz lubaczewski
> <depesz@depesz.com> wrote:
>> On Wed, Jan 04, 2012 at 07:17:17PM +0000, pramsey@cleverelephant.ca wrot=
e:
>>> The following bug has been logged on the website:
>>>
>>> Bug reference: =C2=A0 =C2=A0 =C2=A06379
>>> Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Paul Ramsey
>>> Email address: =C2=A0 =C2=A0 =C2=A0pramsey@cleverelephant.ca
>>> PostgreSQL version: 9.1.2
>>> Operating system: =C2=A0 OSX 10.6.8
>>> Description:
>>>
>>> CREATE OR REPLACE FUNCTION kill_backend()
>>> RETURNS VOID
>>> AS $$
>>> =C2=A0 DROP TABLE if EXISTS foo;
>>> =C2=A0 CREATE TABLE foo AS SELECT * FROM pg_class LIMIT 1;
>>> $$ LANGUAGE 'SQL';
>>
>> Cannot replicate:
>>
>> (depesz@localhost:5910) 20:23:43 [depesz]
>> $ CREATE OR REPLACE FUNCTION kill_backend()
>>>> RETURNS VOID
>>>> AS $$
>>>> =C2=A0 DROP TABLE if EXISTS foo;
>>>> =C2=A0 CREATE TABLE foo AS SELECT * FROM pg_class LIMIT 1;
>>>> $$ LANGUAGE 'SQL';
>> CREATE FUNCTION
>> (depesz@localhost:5910) 20:23:49 [depesz]
>> $ select kill_backend();
>> NOTICE: =C2=A0table "foo" does not exist, skipping
>> CONTEXT: =C2=A0SQL function "kill_backend" statement 1
>> =C2=A0kill_backend
>> --------------
>> =C2=A0[null]
>> (1 row)
>>
>> (depesz@localhost:5910) 20:23:55 [depesz]
>> $ select kill_backend();
>> =C2=A0kill_backend
>> --------------
>> =C2=A0[null]
>> (1 row)
>>
>> (depesz@localhost:5910) 20:23:56 [depesz]
>> $ select kill_backend();
>> =C2=A0kill_backend
>> --------------
>> =C2=A0[null]
>> (1 row)
>>
>> (depesz@localhost:5910) 20:23:58 [depesz]
>> $ select version();
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0version
>> ------------------------------------------------------------------------=
-------------------------------
>> =C2=A0PostgreSQL 9.1.2 on x86_64-unknown-linux-gnu, compiled by gcc-4.6.=
real (Debian 4.6.2-5) 4.6.2, 64-bit
>> (1 row)
>>
>> Side note - definition as is, doesn't work on 9.2:
>> $ CREATE OR REPLACE FUNCTION kill_backend()
>>>> RETURNS VOID
>>>> AS $$
>>>> =C2=A0 DROP TABLE if EXISTS foo;
>>>> =C2=A0 CREATE TABLE foo AS SELECT * FROM pg_class LIMIT 1;
>>>> $$ LANGUAGE 'SQL';
>> ERROR: =C2=A0language "SQL" does not exist
>>
>> changing it to proper sql (not uppercase) fixed this problem.
>>
>> Best regards,
>>
>> depesz
>>
>> --
>> The best thing about modern society is how easy it is to avoid contact w=
ith it.
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 http://d=
epesz.com/
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Paul Ramsey
Date:
Subject: Re: BUG #6379: SQL Function Causes Back-end Crash
Next
From: Paul Ramsey
Date:
Subject: Re: BUG #6379: SQL Function Causes Back-end Crash