alexbrainman / odbc

odbc driver written in go
BSD 3-Clause "New" or "Revised" License
352 stars 140 forks source link

Why not treat error code of 08007 and HY000 as ErrBadConn? #86

Closed lwmonster closed 7 years ago

lwmonster commented 7 years ago

In function NewError, we treat the ODBC error code "08S01" as ErrBadConn, but in HP Vertica, if the connection is bad it will return 08007 or HY000, can we add these two to the following code? if r.State == "08S01" { return driver.ErrBadConn }

lwmonster commented 7 years ago

Actually, when use ODBC on vertica, if a connection is closed by vertica server, the golang sql package can't RECONNECT, because it doesn't received a ErrBadConn error.

alexbrainman commented 7 years ago

in HP Vertica, if the connection is bad it will return 08007 or HY000

Do you have any reference or documentation for that?

can we add these two to the following code?

Sure. If you can provide some reference.

Thank you

Alex

lwmonster commented 7 years ago

It seems the Vertica ODBC driver is not standard, it return HY000 at many circumstances including CONNECTION error and other situation. So, let it go...

alexbrainman commented 7 years ago

So, let it go...

No problem with me. Please, reopen if you think we can do more here.

Alex