pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Error handling in ODBC
6+ messages / 3 participants
[nested] [flat]

* Error handling in ODBC
@ 2001-06-14 06:27  Hiroshi Inoue <Inoue@tpf.co.jp>
  0 siblings, 1 reply; 6+ messages in thread

From: Hiroshi Inoue @ 2001-06-14 06:27 UTC (permalink / raw)
  To: Zoltan Kovacs <tip@pc10.radnoti-szeged.sulinet.hu>; +Cc: pgsql-odbc <pgsql-odbc@postgresql.org>

Hi all,

Recently I found the case that  NOTICE causes an error in ODBC
while examining Kristis' error report.

It seems that NOTICE had never been the cause of SQL_ERROR
before Zoltan's change about a year ago. Before his change *NOTICE*
only caused a PGRES_NONFATAL_ERROR and SC_execute()
returned SQL_SUCCESS_WITH_INFO. However currently *ERROR*
also causes a PGRES_NONFATAL_ERROR and SC_Execute()
returns SQL_ERROR.
Why was this changed ?
I'd like to put it back if there's no reason.

regards,
Hiroshi Inoue



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

* RE: Error handling in ODBC
@ 2001-06-16 15:48  Tibor Laszlo <ltibor@mail.tiszanet.hu>
  parent: Hiroshi Inoue <Inoue@tpf.co.jp>
  0 siblings, 1 reply; 6+ messages in thread

From: Tibor Laszlo @ 2001-06-16 15:48 UTC (permalink / raw)
  To: pgsql-odbc <pgsql-odbc@postgresql.org>; +Cc: Kov當s Zolt疣 <kovzol@math.u-szeged.hu>

Hiroshi Inoue writes:

> Recently I found the case that  NOTICE causes an error in ODBC
> while examining Kristis' error report.
>
> It seems that NOTICE had never been the cause of SQL_ERROR
> before Zoltan's change about a year ago. Before his change *NOTICE*
> only caused a PGRES_NONFATAL_ERROR and SC_execute()
> returned SQL_SUCCESS_WITH_INFO. However currently *ERROR*
> also causes a PGRES_NONFATAL_ERROR and SC_Execute()
> returns SQL_ERROR.
> Why was this changed ?

Zoltan changed the driver because nobody else did it. As I recall, we asked this
list to correct the driver to work correctly with 7.0 pre releases with RI, but
we received no answers. We tried to correct the problem for ouselves. It worked.
But later we were asked to share the patch. Lastly it used to commit the main
CVS by sombody else but we asked this list again to werify the modifycatons by
sombody knowing something about ODBC and the current driver.

> I'd like to put it back if there's no reason.

I think it should be corrected. But if I rmember correctly, the patch was for
report RI violatoions to the app, and these errors comes as NOTICEs not ERRORs.
May I wrong? Is it the case now?

We still use the old patched driver. (It says "(non fatal)" error this case in
the error message - may the shared patch says it too.)

In addition later we encountered the same problem as you... And Zoltan made his
second patch, against the backend to do not drop other NOTICE-s :-) And it works
fine too... :-)) Is somebody interested in? :-)))


Regards,

Tibor Laszlo
ltibor@mail.tiszanet.hu




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

* Re: Error handling in ODBC
@ 2001-06-18 00:58  Hiroshi Inoue <Inoue@tpf.co.jp>
  parent: Tibor Laszlo <ltibor@mail.tiszanet.hu>
  0 siblings, 1 reply; 6+ messages in thread

From: Hiroshi Inoue @ 2001-06-18 00:58 UTC (permalink / raw)
  To: Tibor Laszlo <ltibor@mail.tiszanet.hu>; +Cc: pgsql-odbc <pgsql-odbc@postgresql.org>; kovacsz@pc10.radnoti-szeged.sulinet.hu

Tibor Laszlo wrote:
> 
> Hiroshi Inoue writes:
> 
> > Recently I found the case that  NOTICE causes an error in ODBC
> > while examining Kristis' error report.
> >
> > It seems that NOTICE had never been the cause of SQL_ERROR
> > before Zoltan's change about a year ago. Before his change *NOTICE*
> > only caused a PGRES_NONFATAL_ERROR and SC_execute()
> > returned SQL_SUCCESS_WITH_INFO. However currently *ERROR*
> > also causes a PGRES_NONFATAL_ERROR and SC_Execute()
> > returns SQL_ERROR.
> > Why was this changed ?
> 
> Zoltan changed the driver because nobody else did it. As I recall, we asked this
> list to correct the driver to work correctly with 7.0 pre releases with RI, but
> we received no answers. We tried to correct the problem for ouselves. It worked.
> But later we were asked to share the patch. Lastly it used to commit the main
> CVS by sombody else but we asked this list again to werify the modifycatons by
> sombody knowing something about ODBC and the current driver.
> 

Unfortunately we have no ODBC maintainer.

> > I'd like to put it back if there's no reason.
> 
> I think it should be corrected. But if I rmember correctly, the patch was for
> report RI violatoions to the app, and these errors comes as NOTICEs not ERRORs.
> May I wrong? Is it the case now?
> 

I don't know how it came about. ISTM the old driver didn't
take 'E' after 'C' response into account and failed to report
RI violation errors by ignoring the 'E'.  The 'E' correponds
to an ERROR not a NOTICE.

regards,
Hiroshi Inoue



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

* Re: Error handling in ODBC
@ 2001-06-18 15:29  Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu>
  parent: Hiroshi Inoue <Inoue@tpf.co.jp>
  0 siblings, 1 reply; 6+ messages in thread

From: Kovacs Zoltan @ 2001-06-18 15:29 UTC (permalink / raw)
  To: Hiroshi Inoue <Inoue@tpf.co.jp>; +Cc: Tibor Laszlo <ltibor@mail.tiszanet.hu>; pgsql-odbc <pgsql-odbc@postgresql.org>

On Mon, 18 Jun 2001, Hiroshi Inoue wrote:

> > > Why was this changed ?

The truth is that I don't and didn't understand PostgreSQL internals when
I modified this part of the source. It worked for me and noone complained.

> > > I'd like to put it back if there's no reason.

Yes, of course.

> > I think it should be corrected. But if I rmember correctly, the patch was for
> > report RI violatoions to the app, and these errors comes as NOTICEs not ERRORs.
> > May I wrong? Is it the case now?

Tibor, the referential integrity messages come as 'E'rrors, not
'N'otices:

ERROR:  <unnamed> referential integrity violation - key in
X still referenced from Y

> I don't know how it came about. ISTM the old driver didn't
> take 'E' after 'C' response into account and failed to report
> RI violation errors by ignoring the 'E'.  The 'E' correponds
> to an ERROR not a NOTICE.

IIRC, the reference integrity error reporting didn't work because the
server had some different protocol in sending those letters. In other 
words, the driver didn't handle this type of message well. You may 
almost certainly put back the old code but please check this
part if it is not corrected yet.

Regards, Zoltan




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

* Re: Error handling in ODBC
@ 2001-06-19 00:11  Hiroshi Inoue <Inoue@tpf.co.jp>
  parent: Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu>
  0 siblings, 1 reply; 6+ messages in thread

From: Hiroshi Inoue @ 2001-06-19 00:11 UTC (permalink / raw)
  To: Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu>; +Cc: Tibor Laszlo <ltibor@mail.tiszanet.hu>; pgsql-odbc <pgsql-odbc@postgresql.org>

Kovacs Zoltan wrote:
> 
> On Mon, 18 Jun 2001, Hiroshi Inoue wrote:
> 
> > > > Why was this changed ?
> 
> The truth is that I don't and didn't understand PostgreSQL internals when
> I modified this part of the source. It worked for me and noone complained.
> 
> > > > I'd like to put it back if there's no reason.
> 
> Yes, of course.
> 

OK I would fix it.
ISTM your change was right except setting PGRES_NONFATAL_ERROR
for *ERROR*s.

regards,
Hiroshi Inoue



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

* Re: Error handling in ODBC
@ 2001-06-19 02:21  Hiroshi Inoue <Inoue@tpf.co.jp>
  parent: Hiroshi Inoue <Inoue@tpf.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Hiroshi Inoue @ 2001-06-19 02:21 UTC (permalink / raw)
  To: Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu>; Tibor Laszlo <ltibor@mail.tiszanet.hu>; Dave Page <dpage@vale-housing.co.uk>; Kristis Makris <kristis.makris@datasoft.com>; Mister ics <mister_ics@hotmail.com>; +Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>

Hi all,

I've just committed a fix to cvs.

Changed the error handling as follows.
1) ERRORs causes an SQL_ERROR and the SQLSTATE='S1000'.
2) NOTICEs causes an SQL_SUCCESS_WITH_INFO and the succeeding
   SQLError() returns the NOTICE message.

Remarks.
1) RI violation ERRORs are reported properly.
2) The NOTICE is the last NOTICE message and
   is truncated to 4095 bytes.

regards,
Hiroshi Inoue



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


end of thread, other threads:[~2001-06-19 02:21 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-14 06:27 Error handling in ODBC Hiroshi Inoue <Inoue@tpf.co.jp>
2001-06-16 15:48 ` Tibor Laszlo <ltibor@mail.tiszanet.hu>
2001-06-18 00:58   ` Hiroshi Inoue <Inoue@tpf.co.jp>
2001-06-18 15:29     ` Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu>
2001-06-19 00:11       ` Hiroshi Inoue <Inoue@tpf.co.jp>
2001-06-19 02:21         ` Hiroshi Inoue <Inoue@tpf.co.jp>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox