Re: DIAG [HY000] server closed the connection unexpectedly

From: "Jon Raiford" <Raiford(at)labware(dot)com>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: DIAG [HY000] server closed the connection unexpectedly
Date: 2016-10-19 15:45:57
Message-ID: OFE60A394C.BF6F7493-ON85258051.0055F37A-85258051.00569BA7@LocalDomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi Tsunakawa-san,

Thank you. I can confirm that this does resolve my issue. I am now
seeing an 08001 SQLSTATE when the disconnect first occurs. I have other
issues with my reconnecting code, but at least now I will be able to make
it work.

Assuming this is accepted and committed, is there any idea when an
official updated installer may be posted?

Thanks again,

Jon

pgsql-odbc-owner(at)postgresql(dot)org wrote on 10/19/2016 03:44:09 AM:

> From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
> To: "'Jon Raiford'" <Raiford(at)labware(dot)com>, "pgsql-
> odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
> Date: 10/19/2016 03:44 AM
> Subject: Re: [ODBC] DIAG [HY000] server closed the connection
unexpectedly
> Sent by: pgsql-odbc-owner(at)postgresql(dot)org
>
> Hi, Inoue-san
> cc: Jon
>
> This is rather a bug of psqlODBC. According to the SQLExecDirect
> reference page below, the SQLSTATE should be 08S01.
>
> https://msdn.microsoft.com/en-us/library/ms713611(v=vs.85).aspx
>
> 08S01
> Communication link failure
> The communication link between the driver and the data source to
> which the driver was connected failed before the function completed
> processing.
>
>
>
> The attached patch will fix this. Could you review and commit it?
>
>
> Regards
> Takayuki Tsunakawa
>
> > -----Original Message-----
> > From: pgsql-odbc-owner(at)postgresql(dot)org
> > [mailto:pgsql-odbc-owner(at)postgresql(dot)org] On Behalf Of Jon Raiford
> > Sent: Wednesday, October 19, 2016 5:00 AM
> > To: pgsql-odbc(at)postgresql(dot)org
> > Subject: [ODBC] DIAG [HY000] server closed the connection unexpectedly
> >
> > I am running the 32-bit v9.05.02.10 Unicode ODBC driver in one
environment
> > (dated 15-Apr-2016). I know it may not be the latest version, butcan
anyone
> > tell me if there has been a bug recently with the ODBC driver
answering
> > the wrong SQL_STATE during a database disconnect?
> >
> > Here is a small excerpt from my ODBC trace log. This is the first
error
> > encountered during the connection. Notice that instead of answering
with
> > the SQL STATE [08006] or whatever it is answering a generic [HY000].
This
> > has required quite a lot of effort to hunt this down into a simple
scenario
> > so I'm hopefully someone will tell me it has already been addressed :)
> >
> >
> > v 4348-18a0 ENTER SQLAllocHandle
> > SQLSMALLINT 3 <SQL_HANDLE_STMT>
> > SQLHANDLE 0x02298080
> > SQLHANDLE * 0x0018F0EC
> >
> > v 4348-18a0 EXIT SQLAllocHandle with return
code
> > 0 (SQL_SUCCESS)
> > SQLSMALLINT 3 <SQL_HANDLE_STMT>
> > SQLHANDLE 0x02298080
> > SQLHANDLE * 0x0018F0EC ( 0x0229C4E8)
> >
> > v 4348-18a0 ENTER SQLExecDirectW
> > HSTMT 0x0229C4E8
> > WCHAR * 0x0018F10C [ 4] "asdf"
> > SDWORD 4
> >
> > v 4348-18a0 EXIT SQLExecDirectW with return
code
> > -1 (SQL_ERROR)
> > HSTMT 0x0229C4E8
> > WCHAR * 0x0018F10C [ 4] "asdf"
> > SDWORD 4
> >
> > DIAG [HY000] server closed the connection unexpectedly
> > This probably means the server terminated abnormally
> > before or while processing the request.
> > ;
> > server closed the connection unexpectedly
> > This probably means the server terminated abnormally
> > before or while processing the request.
> > (1)
> >
> >
> >
> >
> > Best Regards,
> >
> > Jon Raiford
> > raiford(at)labware(dot)com
> > Tel: +1 (302) 658-8444
> > http://www.labware.com <http://www.labware.com/> LabWare LIMS
Solutions
> > - Results Count
> [attachment "sqlstate_on_disconnection.patch" deleted by Jon
> Raiford/Employee/LW-US]
> --
> Sent via pgsql-odbc mailing list (pgsql-odbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-odbc

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Jon Raiford 2016-10-19 19:23:45 Re: DIAG [HY000] server closed the connection unexpectedly
Previous Message Tsunakawa, Takayuki 2016-10-19 08:18:06 Re: psqlodbc - SysTAble Prefixes issue