alexbrainman / odbc

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

tests fail with panic: runtime error: cgo argument has Go pointer to Go pointer #87

Open rajender opened 7 years ago

rajender commented 7 years ago

I am trying to connect SQL Server 2016 from CentOS 6.8 using Microsfot ODBC Driver 13 for SQL Server. But getting this error.

go test -mssrv=xxxxxxxx -msdriver="ODBC Driver 13 for SQL Server" -msdb=xxxxxxx -msuser=xxxxxx -mspass=xxxx -v -run=MS

=== RUN TestMSSQLCreateInsertDelete --- FAIL: TestMSSQLCreateInsertDelete (0.23s) mssql_test.go:137: unexpected StmtCount: should=0, is=1 panic: runtime error: cgo argument has Go pointer to Go pointer [recovered] panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 5 [running]: testing.tRunner.func1(0xc4200229c0) /usr/local/go/src/testing/testing.go:622 +0x29d panic(0x5a9ae0, 0xc42001b880) /usr/local/go/src/runtime/panic.go:489 +0x2cf github.com/alexbrainman/odbc/api.SQLBindCol.func1(0x1147cd0, 0xc400040002, 0xc4200175f8, 0x4, 0xc4200175d8, 0x96) /root/go/src/github.com/alexbrainman/odbc/api/zapi_unix.go:28 +0x8b github.com/alexbrainman/odbc/api.SQLBindCol(0x1147cd0, 0x40002, 0xc4200175f8, 0x4, 0xc4200175d8, 0x500000) /root/go/src/github.com/alexbrainman/odbc/api/zapi_unix.go:28 +0x5d github.com/alexbrainman/odbc.(BufferLen).Bind(0xc4200175d8, 0x1147cd0, 0x1, 0xc420000004, 0xc4200175f8, 0x4, 0x8, 0xc420010000) /root/go/src/github.com/alexbrainman/odbc/column.go:32 +0x65 github.com/alexbrainman/odbc.(BindableColumn).Bind(0xc4200175c0, 0x1147cd0, 0x1, 0xc4200175c0, 0x0, 0x0) /root/go/src/github.com/alexbrainman/odbc/column.go:218 +0x6e github.com/alexbrainman/odbc.(ODBCStmt).BindColumns(0xc42005e8c0, 0x8d8c58, 0x0) /root/go/src/github.com/alexbrainman/odbc/odbcstmt.go:146 +0x247 github.com/alexbrainman/odbc.(Stmt).Query(0xc420019140, 0x8d8c58, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /root/go/src/github.com/alexbrainman/odbc/stmt.go:95 +0x104 database/sql.ctxDriverStmtQuery(0x8ae5a0, 0xc42001ae58, 0x8ae6a0, 0xc420019140, 0x8d8c58, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /usr/local/go/src/database/sql/ctxutil.go:95 +0x18c database/sql.rowsiFromStatement(0x8ae5a0, 0xc42001ae58, 0xc420017540, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/local/go/src/database/sql/sql.go:2002 +0x1eb database/sql.(DB).queryConn(0xc42001d220, 0x8ae5a0, 0xc42001ae58, 0xc4200b04d0, 0xc42001b810, 0x5eab8b, 0x44, 0x0, 0x0, 0x0, ...) /usr/local/go/src/database/sql/sql.go:1294 +0x259 database/sql.(DB).query(0xc42001d220, 0x8ae5a0, 0xc42001ae58, 0x5eab8b, 0x44, 0x0, 0x0, 0x0, 0xc42001b601, 0x5daf60, ...) /usr/local/go/src/database/sql/sql.go:1250 +0x12f database/sql.(DB).QueryContext(0xc42001d220, 0x8ae5a0, 0xc42001ae58, 0x5eab8b, 0x44, 0x0, 0x0, 0x0, 0xc42000dcc0, 0x5bab60, ...) /usr/local/go/src/database/sql/sql.go:1227 +0xb8 database/sql.(DB).Query(0xc42001d220, 0x5eab8b, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8ac3e0) /usr/local/go/src/database/sql/sql.go:1241 +0x82 github.com/alexbrainman/odbc.TestMSSQLCreateInsertDelete(0xc4200229c0) /root/go/src/github.com/alexbrainman/odbc/mssql_test.go:328 +0x51f testing.tRunner(0xc4200229c0, 0x5eb540) /usr/local/go/src/testing/testing.go:657 +0x96 created by testing.(*T).Run /usr/local/go/src/testing/testing.go:697 +0x2ca exit status 2 FAIL github.com/alexbrainman/odbc 0.234s

alexbrainman commented 7 years ago

Did you see issue #65 have exactly the same error message? Is your issue a dup of #65 ? What go and github.com/alexbrainman/odbc version do you use? What does "go version" command outputs? What commit for github.com/alexbrainman/odbc you use?

Thank you.

Alex