You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Versions go 1.21 github.com/microsoft/go-mssqldb v1.6.0
Describe the bug
Running $ go test ./... -race results in a data race. See stack trace below. The issue seems to happen when func (r *tdsBuffer) readNextPacket() is writing to a field of the tdsBuffer instance .
During the transaction there are two insert statements happening
The database is running in a docker container with base image from mcr.microsoft.com/mssql/server:2022-latest SELECT @@VERSION; shows
Microsoft SQL Server 2022 (RTM-CU5) (KB5026806) - 16.0.4045.3 (X64)
May 26 2023 12:52:08
Copyright (C) 2022 Microsoft Corporation
Developer Edition (64-bit) on Linux (Ubuntu 20.04.6 LTS) <X64>
I cannot completely rule out that i am doing something wrong, but since I am not using go routines in my part of the code it seems more likely that it might indeed be an issue inside the go-mssqldb package.
The text was updated successfully, but these errors were encountered:
pirm-in
changed the title
Data race when setting size of tdsBuffer in readNextPacket
Data race in readNextPacket of tdsBuffer
Jan 26, 2024
pirm-in
changed the title
Data race in readNextPacket of tdsBuffer
Data race in readNextPacket of tdsBuffer when using sqlx.Transaction
Jan 26, 2024
pirm-in
changed the title
Data race in readNextPacket of tdsBuffer when using sqlx.Transaction
tdsBuffer data race in transaction query with OUTPUT
Jan 29, 2024
Versions
go 1.21
github.com/microsoft/go-mssqldb v1.6.0
Describe the bug
Running
$ go test ./... -race
results in a data race. See stack trace below. The issue seems to happen whenfunc (r *tdsBuffer) readNextPacket()
is writing to a field of the tdsBuffer instance .During the transaction there are two insert statements happening
and later this is called
Edit: I just noticed the data race does not occur when there is no OUTPUT field in the NamedQuery. With the following query there is no data race:
Stack trace:
Further technical details
The database is running in a docker container with base image from
mcr.microsoft.com/mssql/server:2022-latest
SELECT @@VERSION;
showsI cannot completely rule out that i am doing something wrong, but since I am not using go routines in my part of the code it seems more likely that it might indeed be an issue inside the go-mssqldb package.
The text was updated successfully, but these errors were encountered: