From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12882 invoked by alias); 25 Feb 2004 23:30:36 -0000 Mailing-List: contact rhdb-explain-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rhdb-explain-owner@sources.redhat.com Received: (qmail 12870 invoked from network); 25 Feb 2004 23:30:35 -0000 X-Authenticated: #495269 From: Peter Eisentraut To: rhdb-explain@sources.redhat.com Subject: Crash with PostgreSQL 7.4 Date: Wed, 25 Feb 2004 23:30:00 -0000 User-Agent: KMail/1.5.1 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_WATPAv+hm2RZD+3" Message-Id: <200402260030.30671.peter_e@gmx.net> X-SW-Source: 2004-02/txt/msg00000.txt.bz2 --Boundary-00=_WATPAv+hm2RZD+3 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 886 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. --Boundary-00=_WATPAv+hm2RZD+3 Content-Type: text/x-diff; charset="us-ascii"; name="rhdb-explain-hashleftjoin.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rhdb-explain-hashleftjoin.patch" Content-length: 583 *** ../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); --Boundary-00=_WATPAv+hm2RZD+3--