public inbox for rhdb-explain@sourceware.org
 help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: rhdb-explain@sources.redhat.com
Subject: Crash with PostgreSQL 7.4
Date: Wed, 25 Feb 2004 23:30:00 -0000	[thread overview]
Message-ID: <200402260030.30671.peter_e@gmx.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

I have used rhdb-explain from the tag RHDB-3-0 and ran the following
query against an empty PostgreSQL 7.4.1 database:

select * from pg_tables;

This causes a null pointer exception.  The output on the console is

java.lang.NullPointerException
        at com.redhat.rhdb.explain.ExplainParserV73.addQual(ExplainParserV73.java:796)
        at com.redhat.rhdb.explain.ExplainParserV73.buildExplainTree(ExplainParserV73.java:343)
        at com.redhat.rhdb.explain.ExplainParserV73.explain(ExplainParserV73.java:187)
        at com.redhat.rhdb.explain.Explain$ExplainThread.run(Explain.java:298)

The reason is that the parser code only knows "Hash Join" but PG 7.4
emits a "Hash Left Join" in this case.

Attached is a patch that kind of papers over this issue by ignoring
"Left" and other possible hash-join attributes.  Eventually one might
want to show this distinction to the user.

[-- Attachment #2: rhdb-explain-hashleftjoin.patch --]
[-- Type: text/x-diff, Size: 583 bytes --]

*** ../src/rhdb/guitools/rhdb-explain/src/com/redhat/rhdb/explain/ExplainParserV73.java	2003-11-21 19:30:47.000000000 +0100
--- src/com/redhat/rhdb/explain/ExplainParserV73.java	2004-02-25 21:06:04.000000000 +0100
***************
*** 447,452 ****
--- 447,460 ----
  			{
  				String next = strtok.nextToken();
  
+ 				if (next.equals("Left")
+ 				    || next.equals("Right")
+ 				    || next.equals("Full")
+ 				    || next.equals("IN"))
+ 				{
+ 					next = strtok.nextToken();
+ 				}
+ 
  				if (next.equals("Join"))
  				{
  					node.setType(ExplainTreeNode.NODE_JOIN);

             reply	other threads:[~2004-02-25 23:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-25 23:30 Peter Eisentraut [this message]
2004-02-26 17:15 ` Fernando Nasser
2004-02-26 17:43   ` Peter Eisentraut
2004-02-26 18:57     ` Fernando Nasser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200402260030.30671.peter_e@gmx.net \
    --to=peter_e@gmx.net \
    --cc=rhdb-explain@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).