Closed GoogleCodeExporter closed 9 years ago
Kees,
Please, add this line
diff --git a/handle.go b/handle.go
--- a/handle.go
+++ b/handle.go
@@ -33,6 +33,7 @@
func releaseHandle(handle interface{}) error {
h, ht := ToHandleAndType(handle)
ret := api.SQLFreeHandle(ht, h)
+ fmt.Printf("releaseHandle: h=%v ht=%v ret=%v SQL_INVALID_HANDLE=%v\n", h, ht,
ret, api.SQL_INVALID_HANDLE)
if ret == api.SQL_INVALID_HANDLE {
return fmt.Errorf("SQLFreeHandle(%d, %d) returns SQL_INVALID_HANDLE", ht, h)
}
and show its output just before the crash. Thank you.
Alex
Original comment by alex.bra...@gmail.com
on 21 Apr 2013 at 11:58
Here you go:
releaseHandle: h=0x7f689402ac60 ht=3 ret=-1 SQL_INVALID_HANDLE=-2
--- FAIL: TestOdbc (0.08 seconds)
panic: unexpected handle type api.SQLHANDLE [recovered]
panic: unexpected handle type api.SQLHANDLE
Original comment by k...@mroffice.org
on 22 Apr 2013 at 12:31
I think it's related to the query length: it's is rather big - 1559 characters,
most of which are a long list of ID's: "where some_id in (1,2,3,5,8,9,etc)".
The same query works from windows, and if I reduce the number of ID's to reduce
the query length then the query runs on Linux too. Haven't found the sweet spot
yet.
Original comment by k...@mroffice.org
on 22 Apr 2013 at 1:00
The interesting thing is that exactly the same code with exactly the same query
sometimes fails, sometimes passes.
fails looks like this:
releaseHandle: h=0x23ec760 ht=3 ret=-1 SQL_INVALID_HANDLE=-2
and passes look like this:
releaseHandle: h=0xcdd750 ht=3 ret=0 SQL_INVALID_HANDLE=-2
The ratio of passes over fails increases as the query gets shorter but there
doesn't seem to be a pattern. Once it's under some size it seems to always
pass.
Original comment by k...@mroffice.org
on 22 Apr 2013 at 1:16
There is a bug here, for sure. It should not panic. Here is the fix
https://codereview.appspot.com/8902044. Please, see, if it helps you. Instead
of panicing, it should give you a proper error. Perhaps, it will give you a
clue why it fails. It could be some limition of an odbc driver you use.
Alex
Original comment by alex.bra...@gmail.com
on 22 Apr 2013 at 2:16
OK the error was "Got unexpected EOF from server".
I've managed to make the actual error go away too, by adding the tds version to
the connection string: tds_version=8.0;
Thanks for your help!
Original comment by k...@mroffice.org
on 22 Apr 2013 at 2:46
This issue was closed by revision 0cc05e8b93ee.
Original comment by alex.bra...@gmail.com
on 22 Apr 2013 at 3:00
Original issue reported on code.google.com by
alex.bra...@gmail.com
on 21 Apr 2013 at 11:52