pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
reliable way to crash postgres :)
2+ messages / 2 participants
[nested] [flat]

* reliable way to crash postgres :)
@ 1999-09-14 08:00  Jens Glaser <jens@helena.jens.de>
  0 siblings, 1 reply; 2+ messages in thread

From: Jens Glaser @ 1999-09-14 08:00 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I think I've found a pretty reliable way to crash my pgsql backend.

To reproduce (at least on 6.5.1.) enter:

   select * from pg_attribute where (case when 1=1 then 
     (attname='testname') else (0=1) end);

I chose the pg_attribute table because it exists on every system :),
while the query does not look to make too much sense I orignally
wanted to implement different WHERE conditions based on another
condition (here just 1=1 :-)

Regards,

-- 
Jens Glaser     Am Holderstrauch 13, 36041 Fulda, 0661/9429507    jens@jens.de





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] reliable way to crash postgres :)
@ 1999-09-14 20:29  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jens Glaser <jens@helena.jens.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 1999-09-14 20:29 UTC (permalink / raw)
  To: jens@jens.de; +Cc: pgsql-sql

Jens Glaser <jens@helena.jens.de> writes:
>    select * from pg_attribute where (case when 1=1 then 
>      (attname='testname') else (0=1) end);

This is fixed in current sources, but for some reason it didn't get
back-patched into REL6_5.  Done now.  Here's the patch if you're in a
hurry.

inline patch 1: backend/optimizer/path/indxpath.c (+5/-4 lines) download inline-1.patch*** backend/optimizer/path/indxpath.c.orig Sat Jun 19 00:54:14 1999 --- backend/optimizer/path/indxpath.c Tue Sep 14 16:26:02 1999 *************** *** 585,596 **** Oid restrict_op = InvalidOid; bool isIndexable = false; ! if (or_clause((Node *) clause) || ! not_clause((Node *) clause) || single_node((Node *) clause)) ! return (RestrictInfo *) NULL; ! leftop = get_leftop(clause); rightop = get_rightop(clause); /* * If this is not a join clause, check for clauses of the form: --- 585,597 ---- Oid restrict_op = InvalidOid; bool isIndexable = false; ! /* Clause must be a binary opclause. */ ! if (! is_opclause((Node *) clause)) ! return NULL; leftop = get_leftop(clause); rightop = get_rightop(clause); + if (! leftop || ! rightop) + return NULL; /* * If this is not a join clause, check for clauses of the form:
regards, tom lane ^ permalink raw reply [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-09-14 20:29 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-09-14 08:00 reliable way to crash postgres :) Jens Glaser <jens@helena.jens.de>
1999-09-14 20:29 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox