RE: [JDBC] Bug found in the driver

2001-08-08 Thread Dave Cramer

Denis,

Can you do me a favour, and post a small program which can reproduce
your results.
If you have already done so, let me know and I will go and find it.

Dave

-Original Message-
From: Denis Bucher [mailto:[EMAIL PROTECTED]] 
Sent: August 8, 2001 9:56 AM
To: PGSQL-JDBC
Cc: [EMAIL PROTECTED]
Subject: RE: [JDBC] Bug found in the driver


At 09:05 08.08.01 -0400, you wrote:
>Denis,
>
>Do you get this error with current binaries from 
>http://jdbc.fastcrypt.com

Yes, with the latest binaries I get approximately :

EXCEPTION Quelque chose de peu commun sest produit pour faire ??chouer
le gestionnaire. Veuillez enregistrer cette exception: {0}

You can find it into : org/postgres/errors_fr.properties

With my modified/kludge version I get :

"... java.sql.SQLException: Password authentification failed for user
'test'"

Denis

>-Original Message-
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED]] On Behalf Of Denis Bucher
>Sent: August 8, 2001 7:44 AM
>To: Steve Wampler
>Cc: PGSQL-JDBC
>Subject: Re: [JDBC] Bug found in the driver
>
>
>At 11:07 07.08.01 -0700, you wrote:
>
>Hello !
>
> > > I agree with you. But is there someone that could find the exact 
> > > place to correct it ? This would be nice... And it would spare 
> > > some time in the mailling-lists, just do a google.com search at 
> > > "unusual"
>
> > > and you'll see
> > ;-))
> >
> >I thought I'd take more of a look at this (because I don't want to do

> >the work I'm supposed to be doing!).  It looks for all the world to 
> >me that the code is correct and that somehow MessageFormat.format() 
> >isn't working properly.  This is, of course, unlikely, since I'm 
> >pretty sure Sun has tested MessageFormat quite a bit!
> >
> >Do you have a simple test case I can run that will show the problem? 
> >There's not much I can do without being able to reproduce the 
> >problem.
>
>It is very easy to reproduce the bug !
>
>Just change you pg_hba.conf so that the host on which you are has got 
>no entry. And you'll see :
>
>Instead of saying "unusual error, please record the following exception
>: No pg_hba.conf entry for host 192.168.200.4, user postgres database 
>test" (or something like that) it will say only :
>
>"unusual error, please record the following exception : {0}"
>
>Denis
>
>
>
>---(end of 
>broadcast)---
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html
>
>
>
>---(end of 
>broadcast)---
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



RE: [JDBC] Bug found in the driver

2001-08-08 Thread Denis Bucher

At 09:05 08.08.01 -0400, you wrote:
>Denis,
>
>Do you get this error with current binaries from
>http://jdbc.fastcrypt.com

Yes, with the latest binaries I get approximately :

EXCEPTION Quelque chose de peu commun sest produit pour faire ??chouer le
gestionnaire. Veuillez enregistrer cette exception: {0}

You can find it into : org/postgres/errors_fr.properties

With my modified/kludge version I get :

"... java.sql.SQLException: Password authentification failed for user 'test'"

Denis

>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]] On Behalf Of Denis Bucher
>Sent: August 8, 2001 7:44 AM
>To: Steve Wampler
>Cc: PGSQL-JDBC
>Subject: Re: [JDBC] Bug found in the driver
>
>
>At 11:07 07.08.01 -0700, you wrote:
>
>Hello !
>
> > > I agree with you. But is there someone that could find the exact
> > > place to correct it ? This would be nice... And it would spare some
> > > time in the mailling-lists, just do a google.com search at "unusual"
>
> > > and you'll see
> > ;-))
> >
> >I thought I'd take more of a look at this (because I don't want to do
> >the work I'm supposed to be doing!).  It looks for all the world to me
> >that the code is correct and that somehow MessageFormat.format() isn't
> >working properly.  This is, of course, unlikely, since I'm pretty sure
> >Sun has tested MessageFormat quite a bit!
> >
> >Do you have a simple test case I can run that will show the problem?
> >There's not much I can do without being able to reproduce the problem.
>
>It is very easy to reproduce the bug !
>
>Just change you pg_hba.conf so that the host on which you are has got no
>entry. And you'll see :
>
>Instead of saying "unusual error, please record the following exception
>: No pg_hba.conf entry for host 192.168.200.4, user postgres database
>test" (or something like that) it will say only :
>
>"unusual error, please record the following exception : {0}"
>
>Denis
>
>
>
>---(end of broadcast)---
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html
>
>
>
>---(end of broadcast)---
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



RE: [JDBC] Bug found in the driver

2001-08-08 Thread Dave Cramer

Denis,

Do you get this error with current binaries from 

http://jdbc.fastcrypt.com

Regards,

Dave

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Denis Bucher
Sent: August 8, 2001 7:44 AM
To: Steve Wampler
Cc: PGSQL-JDBC
Subject: Re: [JDBC] Bug found in the driver


At 11:07 07.08.01 -0700, you wrote:

Hello !

> > I agree with you. But is there someone that could find the exact 
> > place to correct it ? This would be nice... And it would spare some 
> > time in the mailling-lists, just do a google.com search at "unusual"

> > and you'll see
> ;-))
>
>I thought I'd take more of a look at this (because I don't want to do 
>the work I'm supposed to be doing!).  It looks for all the world to me 
>that the code is correct and that somehow MessageFormat.format() isn't 
>working properly.  This is, of course, unlikely, since I'm pretty sure 
>Sun has tested MessageFormat quite a bit!
>
>Do you have a simple test case I can run that will show the problem? 
>There's not much I can do without being able to reproduce the problem.

It is very easy to reproduce the bug !

Just change you pg_hba.conf so that the host on which you are has got no
entry. And you'll see :

Instead of saying "unusual error, please record the following exception
: No pg_hba.conf entry for host 192.168.200.4, user postgres database
test" (or something like that) it will say only :

"unusual error, please record the following exception : {0}"

Denis



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [JDBC] Bug found in the driver

2001-08-08 Thread Denis Bucher

At 11:07 07.08.01 -0700, you wrote:

Hello !

> > I agree with you. But is there someone that could find the exact place to
> > correct it ? This would be nice... And it would spare some time in the
> > mailling-lists, just do a google.com search at "unusual" and you'll see 
> ;-))
>
>I thought I'd take more of a look at this (because I don't want to do the
>work I'm supposed to be doing!).  It looks for all the world to me that
>the code is correct and that somehow MessageFormat.format() isn't working
>properly.  This is, of course, unlikely, since I'm pretty sure Sun has
>tested MessageFormat quite a bit!
>
>Do you have a simple test case I can run that will show the problem?
>There's not much I can do without being able to reproduce the problem.

It is very easy to reproduce the bug !

Just change you pg_hba.conf so that the host on which you are has
got no entry. And you'll see :

Instead of saying "unusual error, please record the following exception :
No pg_hba.conf entry for host 192.168.200.4, user postgres database
test" (or something like that) it will say only :

"unusual error, please record the following exception : {0}"

Denis



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [JDBC] Bug found in the driver

2001-08-07 Thread Steve Wampler

Denis Bucher wrote:
> 
> At 22:01 03.08.01 +0200, Rene Pijlman wrote:
> >On Fri, 03 Aug 2001 15:06:46 +0200, Denis Bucher wrote:
> > >I've FOUND A BUG in the postgres JDBC driver !
> >
> >OK, please help us fix it.
> >
> > >If you want to see the source online :
> > >http://cs.baylor.edu/~speegle/5335/org/postgresql/
> > >
> > >Please look at Driver.class :
> > >
> > > } catch(Exception ex2) {
> > > throw new PSQLException("postgresql.unusual",ex2);
> > >
> > >But it doesn't print the exception ex2 !!!
> >
> >This code is not supposed to print an exception. Please be more
> >specific. What are you doing exactly? Why are we looking at this
> >particular line of source code? What exception did you expect?
> >Why did you expect it to be printed?
> 
> And in brief :
> 
> When there is an unexpected exception like "host not found in hba_conf",
> the driver throws this "postgres.unusual" exception.
> 
> This exception is in the "errors.properties" file, and the exception SHOULD
> be printed for two reasons : 1. in the source, "ex2" is specified, and 2. the
> error tells us "to record the following exception"
> 
> And a lot of people post to mailing-lists because the exception is not printed,
> if it was people wouldn't ask, because the text would be clear enough to them.
> 
> Therefore, it seems there is a bug (the exception is not printed) and even
> if this
> wasn't the aim, the exception SHOULD be printed because it would help people
> a lot debbuging their applications...

I don't agree that the above code should print the exception.  It seems to
me that the above code is correct in simply throwing the exception.  It's
where the exception is *caught* that things go wrong.  At that point, whatever
prints the *name* of the exception should also print the *message*, and isn't.  Now,
it may well be that PSQLException() isn't implementing toString() properly and is
the real culprit...

In short, yes, there's probably a bug, but it's not at this point in the code...
--
Steve Wampler-  SOLIS Project, National Solar Observatory
[EMAIL PROTECTED]

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [JDBC] Bug found in the driver

2001-08-06 Thread Denis Bucher

At 22:01 03.08.01 +0200, Rene Pijlman wrote:
>On Fri, 03 Aug 2001 15:06:46 +0200, Denis Bucher wrote:
> >I've FOUND A BUG in the postgres JDBC driver !
>
>OK, please help us fix it.
>
> >If you want to see the source online :
> >http://cs.baylor.edu/~speegle/5335/org/postgresql/
> >
> >Please look at Driver.class :
> >
> > } catch(Exception ex2) {
> > throw new PSQLException("postgresql.unusual",ex2);
> >
> >But it doesn't print the exception ex2 !!!
>
>This code is not supposed to print an exception. Please be more
>specific. What are you doing exactly? Why are we looking at this
>particular line of source code? What exception did you expect?
>Why did you expect it to be printed?

And in brief :

When there is an unexpected exception like "host not found in hba_conf",
the driver throws this "postgres.unusual" exception.

This exception is in the "errors.properties" file, and the exception SHOULD
be printed for two reasons : 1. in the source, "ex2" is specified, and 2. the
error tells us "to record the following exception"

And a lot of people post to mailing-lists because the exception is not printed,
if it was people wouldn't ask, because the text would be clear enough to them.

Therefore, it seems there is a bug (the exception is not printed) and even 
if this
wasn't the aim, the exception SHOULD be printed because it would help people
a lot debbuging their applications...

Denis


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [JDBC] Bug found in the driver

2001-08-06 Thread Denis Bucher

At 22:01 03.08.01 +0200, you wrote:

Hello !

>On Fri, 03 Aug 2001 15:06:46 +0200, Denis Bucher wrote:
> >I've FOUND A BUG in the postgres JDBC driver !
>
>OK, please help us fix it.
>
> >If you want to see the source online :
> >http://cs.baylor.edu/~speegle/5335/org/postgresql/
> >
> >Please look at Driver.class :
> >
> > } catch(Exception ex2) {
> > throw new PSQLException("postgresql.unusual",ex2);
> >
> >But it doesn't print the exception ex2 !!!
>
>This code is not supposed to print an exception. Please be more
>specific. What are you doing exactly? Why are we looking at this
>particular line of source code? What exception did you expect?
>Why did you expect it to be printed?

Ok, this line prints the following message :

Quelque chose de peu commun s'est produit pour faire échouer le
gestionnaire. Veuillez enregistrer cette exception: {0}

which is the french version of :

Something unusual has occured to cause the driver to fail.
Please report this exception: {0}

BUT it doesn't print the exception between '{' and '}' which makes
VERY hard to debug the problem. I found LOTS of emails in
mailing-lists only due to this problem : If the exception was
printed, people wouldn't have asked because they would have
seen "this host is not present in hba_conf", or something like
that. With my 'kludge-correction' it PRINTS the EXACT exception
that made the driver fail :

throw new PSQLException("postgresql.unusual: " + ex2);

But I know my correction isn't 'clean' because it circumvents the
PSQLException method that IMHO SHOULD print out the exception,
or else why the hell would there be that message "please report this
exception : {0}" AND why whould 'ex2' be mentionned ?

Denis


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]