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.
------------------------------------------------------------------------
*** ../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);