public inbox for rhdb-explain@sourceware.org
 help / color / mirror / Atom feed
* Crash with PostgreSQL 7.4
@ 2004-02-25 23:30 Peter Eisentraut
  2004-02-26 17:15 ` Fernando Nasser
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Eisentraut @ 2004-02-25 23:30 UTC (permalink / raw)
  To: rhdb-explain

[-- 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);

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

end of thread, other threads:[~2004-02-26 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25 23:30 Crash with PostgreSQL 7.4 Peter Eisentraut
2004-02-26 17:15 ` Fernando Nasser
2004-02-26 17:43   ` Peter Eisentraut
2004-02-26 18:57     ` Fernando Nasser

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).