* 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
* Re: Crash with PostgreSQL 7.4
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
0 siblings, 1 reply; 4+ messages in thread
From: Fernando Nasser @ 2004-02-26 17:15 UTC (permalink / raw)
To: Peter Eisentraut; +Cc: rhdb-explain
Hi Peter,
Thank you for your report.
Apparently these nodes were added since I last looked at it. I thought I had
added all the new nodes....
I wonder if this is not already in the rdhb-explain cvs tip. Originally
RHDB-3-0 was a 7.3.x release and I may have avoided changing the branch.
Best regards,
Fernando
Peter Eisentraut wrote:
> 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);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Crash with PostgreSQL 7.4
2004-02-26 17:15 ` Fernando Nasser
@ 2004-02-26 17:43 ` Peter Eisentraut
2004-02-26 18:57 ` Fernando Nasser
0 siblings, 1 reply; 4+ messages in thread
From: Peter Eisentraut @ 2004-02-26 17:43 UTC (permalink / raw)
To: Fernando Nasser; +Cc: rhdb-explain
Fernando Nasser wrote:
> I wonder if this is not already in the rdhb-explain cvs tip.
> Originally RHDB-3-0 was a 7.3.x release and I may have avoided
> changing the branch.
AFAICT, the code in the head and in the RHDB-3-0 branch is all the same.
Also, the RHDB-3-0 code does contain a comment that it was modified for
7.4, so I figured it was a plain oversight.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Crash with PostgreSQL 7.4
2004-02-26 17:43 ` Peter Eisentraut
@ 2004-02-26 18:57 ` Fernando Nasser
0 siblings, 0 replies; 4+ messages in thread
From: Fernando Nasser @ 2004-02-26 18:57 UTC (permalink / raw)
To: Peter Eisentraut; +Cc: rhdb-explain, David Jee
Peter Eisentraut wrote:
> Fernando Nasser wrote:
>
>>I wonder if this is not already in the rdhb-explain cvs tip.
>>Originally RHDB-3-0 was a 7.3.x release and I may have avoided
>>changing the branch.
>
>
> AFAICT, the code in the head and in the RHDB-3-0 branch is all the same.
> Also, the RHDB-3-0 code does contain a comment that it was modified for
> 7.4, so I figured it was a plain oversight.
>
>
Probably. When I've adapted rhdb-explain for 7.4 there was no real 7.4 yet,
just the tip of the development cvs branch. Maybe these node types where added
after I did that.
I will make the correction and see if an update can be packaged for Fedora.
Thanks again for the report.
Regards,
Fernando
^ 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).