Skip to content

Releases: denisenkom/go-mssqldb

April 2021

14 Apr 00:28
d9abbec
Compare
Choose a tag to compare
April 2021 Pre-release
Pre-release
Workaround for Go 1.16 (#642)

* Fix Go1.16

* Add more tests

* Add build tag

* Add Go 1.16 to appveyor.yml

First release

03 Nov 05:10
Compare
Choose a tag to compare
First release Pre-release
Pre-release
Disable logging in go routine

Logging was causing data race error.
Here is one example of such error (from https://ci.appveyor.com/project/denisenkom/go-mssqldb/builds/36105319/job/qrymmer7mnvkbv2p):
```
2020/11/03 03:32:09 initiating response reading
2020/11/03 03:32:09 got token tokenLoginAck
2020/11/03 03:32:09 got token tokenEnvChange
2020/11/03 03:32:09 got token tokenDone
2020/11/03 03:32:09 got DONE or DONEPROC status=0
2020/11/03 03:32:09 response finished
2020/11/03 03:32:09
SET XACT_ABORT ON; -- 16384
SET ANSI_NULLS ON; -- 32
SET ARITHIGNORE ON; -- 128
2020/11/03 03:32:09 initiating response reading
2020/11/03 03:32:09 got token tokenEnvChange
2020/11/03 03:32:09 got token tokenDone
2020/11/03 03:32:09 got DONE or DONEPROC status=1
2020/11/03 03:32:09 got token tokenDone
2020/11/03 03:32:09 got DONE or DONEPROC status=1
2020/11/03 03:32:09 got token tokenDone
2020/11/03 03:32:09 got DONE or DONEPROC status=0
2020/11/03 03:32:09 response finished
2020/11/03 03:32:09
select Options = @@OPTIONS;
2020/11/03 03:32:09 initiating response reading
2020/11/03 03:32:09 got token tokenColMetadata
2020/11/03 03:32:09 got token tokenRow
2020/11/03 03:32:09 got token tokenDone
2020/11/03 03:32:09 got DONE or DONEPROC status=16
2020/11/03 03:32:09 (1 row(s) affected)
2020/11/03 03:32:09 response finished
2020/11/03 03:32:09
SET XACT_ABORT ON; -- 16384
SET ANSI_NULLS ON; -- 32
SET ARITHIGNORE ON; -- 128
2020/11/03 03:32:09 initiating response reading
2020/11/03 03:32:09 got token tokenEnvChange
2020/11/03 03:32:09 got token tokenDone
2020/11/03 03:32:09 got DONE or DONEPROC status=1
2020/11/03 03:32:09 got token tokenDone
2020/11/03 03:32:09 got DONE or DONEPROC status=1
2020/11/03 03:32:09 got token tokenDone
2020/11/03 03:32:09 got DONE or DONEPROC status=0
2020/11/03 03:32:09 response finished
==================
WARNING: DATA RACE
Read at 0x00c00033a043 by goroutine 55:
  testing.(*common).logDepth()
      c:/go113/src/testing/testing.go:665 +0xa8
  testing.(*common).Log()
      c:/go113/src/testing/testing.go:658 +0x7e
  github.com/denisenkom/go-mssqldb.testLogger.Println()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/tds_test.go:224 +0x5f
  github.com/denisenkom/go-mssqldb.optionalLogger.Println()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/log.go:26 +0xa1
  github.com/denisenkom/go-mssqldb.(*parseResp).dlog()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/token.go:708 +0x176
  github.com/denisenkom/go-mssqldb.(*parseResp).iter()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/token.go:725 +0xcc6
  github.com/denisenkom/go-mssqldb.processResponse()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/token.go:813 +0x17c
Previous write at 0x00c00033a043 by goroutine 40:
  testing.tRunner.func1()
      c:/go113/src/testing/testing.go:900 +0x35a
  testing.tRunner()
      c:/go113/src/testing/testing.go:913 +0x1c2
Goroutine 55 (running) created at:
  github.com/denisenkom/go-mssqldb.(*Stmt).processQueryResponse()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/mssql.go:600 +0x1a5
  github.com/denisenkom/go-mssqldb.(*Stmt).queryContext()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/mssql.go:594 +0x1c2
  github.com/denisenkom/go-mssqldb.(*Stmt).Query()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/mssql.go:584 +0xbe
  github.com/denisenkom/go-mssqldb.TestQueryCancelLowLevel()
      C:/gopath/src/github.com/denisenkom/go-mssqldb/queries_test.go:1805 +0x54c
  testing.tRunner()
      c:/go113/src/testing/testing.go:909 +0x1a0
Goroutine 40 (running) created at:
  testing.(*T).Run()
      c:/go113/src/testing/testing.go:960 +0x658
  testing.runTests.func1()
      c:/go113/src/testing/testing.go:1202 +0xad
  testing.tRunner()
      c:/go113/src/testing/testing.go:909 +0x1a0
  testing.runTests()
      c:/go113/src/testing/testing.go:1200 +0x528
  testing.(*M).Run()
      c:/go113/src/testing/testing.go:1117 +0x306
  main.main()
      _testmain.go:362 +0x33e
==================
2020/11/03 03:32:18 [{Hello} {World} {TVP}]
FAIL
coverage: 78.2% of statements
exit status 1
```

Testing data race

Testing data race

Testing data race

Testing data race

Testing data race

add comment