Skip to content

fix: validate PRELOGIN encryption response length - #417

Draft
Chris LaFreniere (chlafreniere) wants to merge 1 commit into
mainfrom
dev/chlafren/encryptBytes
Draft

fix: validate PRELOGIN encryption response length#417
Chris LaFreniere (chlafreniere) wants to merge 1 commit into
mainfrom
dev/chlafren/encryptBytes

Conversation

@chlafreniere

Copy link
Copy Markdown

Summary

  • reject PRELOGIN encryption responses whose payload length is not exactly one byte
  • add regression coverage for missing, empty, oversized, and valid encryption options
  • extend FuzzReadPrelogin through interpretPreloginResponse so parsed server responses exercise their consumer

Security impact

A malicious server could send a zero-length PRELOGIN encryption option. readPrelogin returned the option as an empty slice, and interpretPreloginResponse indexed its first byte without validating the length, causing an unrecovered panic before authentication and, for non-strict connections, before TLS negotiation.

Malformed encryption options now return an error instead of terminating the client process.

Testing

  • go test . -run '^(TestInterpretPreloginResponseEncryptionLength|FuzzReadPrelogin)$'
  • go test . -run '^$' -fuzz '^FuzzReadPrelogin$' -fuzztime 10s (19,005 executions)
  • go test ./msdsn ./internal/... ./integratedauth/... ./azuread
  • go build .

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Benchmark Results (main vs PR)

Click to expand benchstat output
goos: linux
goarch: amd64
pkg: github.com/microsoft/go-mssqldb
cpu: INTEL(R) XEON(R) PLATINUM 8573C
                         │ bench_old.txt │            bench_new.txt            │
                         │    sec/op     │    sec/op     vs base               │
TdsBuffer_Write_Small-4               9.359n ±  2%    9.179n ± 1%  -1.93% (p=0.002 n=10)
TdsBuffer_Write_Medium-4              19.60n ±  2%    18.86n ± 2%  -3.80% (p=0.000 n=10)
TdsBuffer_Write_Large-4               79.69n ±  1%    78.30n ± 2%  -1.75% (p=0.000 n=10)
TdsBuffer_WriteByte-4                 218.6n ±  1%    217.3n ± 1%       ~ (p=0.592 n=10)
TdsBuffer_Read_Small-4                7.714n ±  2%    7.601n ± 2%       ~ (p=0.035 n=10)
TdsBuffer_ReadByte-4                  169.5n ±  2%    170.1n ± 2%       ~ (p=0.469 n=10)
TdsBuffer_Uint16-4                   101.50n ±  1%    99.74n ± 2%  -1.73% (p=0.001 n=10)
TdsBuffer_Uint32-4                    102.2n ±  2%    102.1n ± 1%       ~ (p=0.617 n=10)
TdsBuffer_Uint64-4                    132.3n ±  2%    130.9n ± 2%       ~ (p=0.362 n=10)
TdsBuffer_BeginFinishPacket-4         4.649n ±  2%    4.635n ± 3%       ~ (p=0.853 n=10)
ReadBVarCharOrPanicWideChars-4        140.9n ±  1%    138.8n ± 2%       ~ (p=0.027 n=10)
ReadBVarCharOrPanicOnly1WideChar-4    164.2n ±  3%    164.5n ± 1%       ~ (p=0.493 n=10)
BulkMakeParam_Int64-4                 34.82n ±  1%    35.36n ± 2%       ~ (p=0.072 n=10)
BulkMakeParam_Int32-4                 33.53n ±  2%    33.38n ± 1%       ~ (p=0.912 n=10)
BulkMakeParam_Float64-4               35.07n ±  2%    35.25n ± 1%       ~ (p=0.184 n=10)
BulkMakeParam_String_NVarChar-4       227.1n ±  1%    225.5n ± 1%       ~ (p=0.085 n=10)
BulkMakeParam_String_VarChar-4        51.86n ±  2%    51.50n ± 2%       ~ (p=0.128 n=10)
BulkMakeParam_DateTime-4              82.45n ±  1%    81.82n ± 1%       ~ (p=0.128 n=10)
BulkMakeParam_DateTime2-4             85.27n ±  3%    85.00n ± 2%       ~ (p=0.383 n=10)
BulkMakeParam_Bool-4                  34.89n ±  2%    33.98n ± 2%       ~ (p=0.025 n=10)
BulkMakeParam_MultiColumn-4           231.7n ±  1%    224.7n ± 2%  -3.04% (p=0.000 n=10)
ConvertAssign_StringToString-4        20.40n ±  1%    19.82n ± 1%  -2.82% (p=0.000 n=10)
ConvertAssign_StringToBytes-4         47.43n ±  2%    46.81n ± 2%  -1.31% (p=0.007 n=10)
ConvertAssign_BytesToString-4         61.88n ±  1%    62.10n ± 1%       ~ (p=0.225 n=10)
ConvertAssign_BytesToBytes-4          61.93n ±  2%    61.85n ± 1%       ~ (p=0.796 n=10)
ConvertAssign_Int64ToInt64-4          34.81n ±  1%    35.26n ± 1%  +1.28% (p=0.003 n=10)
ConvertAssign_Int64ToString-4         55.28n ±  1%    53.89n ± 2%  -2.51% (p=0.000 n=10)
ConvertAssign_Float64ToFloat64-4      35.03n ±  1%    34.35n ± 3%       ~ (p=0.089 n=10)
ConvertAssign_TimeToTime-4            43.52n ±  2%    43.15n ± 1%       ~ (p=0.063 n=10)
ConvertAssign_TimeToString-4          118.5n ±  4%    116.0n ± 2%  -2.07% (p=0.002 n=10)
ConvertAssign_NilToBytes-4            21.62n ±  1%    21.20n ± 1%  -1.97% (p=0.000 n=10)
ConvertAssign_Int64ToInterface-4      21.00n ±  1%    20.69n ± 2%  -1.50% (p=0.008 n=10)
ConvertAssign_StringToRawBytes-4      50.07n ±  2%    49.79n ± 1%       ~ (p=0.143 n=10)
ConvertAssign_BoolToBool-4            12.27n ±  2%    12.16n ± 2%       ~ (p=0.041 n=10)
RoundTrip_ConnectDisconnect-4         90.13m ±  2%    89.26m ± 2%       ~ (p=0.436 n=10)
RoundTrip_Select1-4                   253.5µ ±  1%    247.6µ ± 2%  -2.32% (p=0.001 n=10)
RoundTrip_ParamQuery-4                203.2µ ±  2%    201.2µ ± 1%       ~ (p=0.015 n=10)
RoundTrip_MultiRow-4                  628.1µ ±  2%    608.4µ ± 2%  -3.15% (p=0.000 n=10)
RoundTrip_LargeResultSet-4            3.691m ±  1%    3.577m ± 1%  -3.07% (p=0.000 n=10)
RoundTrip_ExecInsert-4                216.8µ ±  3%    212.5µ ± 2%  -2.01% (p=0.004 n=10)
RoundTrip_StoredProc-4                213.5µ ±  2%    209.9µ ± 1%       ~ (p=0.043 n=10)
RoundTrip_Transaction-4               564.0µ ±  5%    566.1µ ± 1%       ~ (p=0.353 n=10)
RoundTrip_BulkInsert/Rows_100-4       3.429m ± 26%    3.426m ± 2%       ~ (p=0.796 n=10)
RoundTrip_BulkInsert/Rows_1000-4      4.880m ±  2%    4.946m ± 2%       ~ (p=0.052 n=10)
RoundTrip_ConcurrentQueries-4         107.4µ ±  3%    115.4µ ± 9%       ~ (p=0.035 n=10)
RoundTrip_MixedTypes-4                323.2µ ±  3%    334.7µ ± 3%  +3.56% (p=0.009 n=10)
RoundTrip_LargePayload-4              400.3µ ±  1%    401.7µ ± 1%       ~ (p=0.436 n=10)
RoundTrip_PreparedStmt-4              196.9µ ±  2%    196.2µ ± 1%       ~ (p=0.684 n=10)
RoundTrip_MessageQuery-4              428.0µ ±  2%    427.9µ ± 4%       ~ (p=0.481 n=10)
WriteTypeInfo_Int8-4                  39.36n ±  2%    38.78n ± 1%       ~ (p=0.019 n=10)
WriteTypeInfo_NVarChar-4              85.41n ±  1%    82.83n ± 2%  -3.03% (p=0.000 n=10)
WriteTypeInfo_NVarCharMax-4           85.73n ±  1%    82.57n ± 1%  -3.69% (p=0.000 n=10)
WriteByteLenType-4                    24.93n ±  2%    24.99n ± 2%       ~ (p=0.255 n=10)
WriteShortLenType-4                   27.83n ±  1%    28.22n ± 1%  +1.40% (p=0.006 n=10)
WritePLPType_Short-4                  70.31n ±  2%    71.86n ± 1%  +2.20% (p=0.000 n=10)
SendRpc_SingleIntParam-4              13.37µ ± 10%    13.36µ ± 5%       ~ (p=0.529 n=10)
Str2ucs2_Short-4                      85.46n ±  2%    87.19n ± 1%  +2.02% (p=0.003 n=10)
Str2ucs2_Medium-4                     175.7n ±  3%    172.8n ± 2%       ~ (p=0.363 n=10)
Str2ucs2_Long-4                       580.3n ±  3%    586.9n ± 2%       ~ (p=0.159 n=10)
Ucs22str_ASCII-4                      53.51n ±  2%    55.57n ± 2%  +3.85% (p=0.000 n=10)
Ucs22str_Unicode-4                    187.2n ±  2%    193.2n ± 2%  +3.21% (p=0.001 n=10)
Ucs22str_LongASCII-4                  98.30n ±  1%   100.30n ± 1%  +2.04% (p=0.000 n=10)
ManglePassword_Short-4                103.5n ±  2%    107.8n ± 1%  +4.15% (p=0.000 n=10)
ManglePassword_Long-4                 362.9n ±  2%    369.7n ± 1%       ~ (p=0.014 n=10)
SendLogin-4                           1.203µ ±  2%    1.246µ ± 1%  +3.58% (p=0.000 n=10)
WritePrelogin-4                       523.2n ±  1%    536.9n ± 1%  +2.62% (p=0.001 n=10)
Ucs22strAscii-4                       12.40n ±  2%    12.69n ± 1%  +2.38% (p=0.000 n=10)
Ucs22strMediumAscii-4                 19.97n ±  1%    20.15n ± 1%       ~ (p=0.159 n=10)
Ucs22strLongAscii-4                   47.01n ±  1%    47.15n ± 2%       ~ (p=0.592 n=10)
Ucs22strLongerAscii-4                 335.0n ±  2%    337.7n ± 2%       ~ (p=0.183 n=10)
Ucs22strTrailingUnicode-4             129.4n ±  1%    132.8n ± 2%  +2.59% (p=0.002 n=10)
Ucs22strLongEmojis-4                  202.6n ±  1%    205.0n ± 1%  +1.18% (p=0.002 n=10)
ParseDone-4                           6.452n ±  2%    6.484n ± 1%       ~ (p=0.796 n=10)
ParseDoneInProc-4                     6.213n ±  1%    6.418n ± 3%  +3.29% (p=0.000 n=10)
ParseReturnStatus-4                   1.900n ±  2%    1.918n ± 2%       ~ (p=0.197 n=10)
ParseOrder-4                          20.24n ±  1%    20.86n ± 1%  +3.01% (p=0.000 n=10)
ParseError72-4                        178.2n ±  1%    175.2n ± 2%       ~ (p=0.045 n=10)
ParseInfo-4                           186.0n ±  2%    188.1n ± 1%       ~ (p=0.089 n=10)
ParseLoginAck-4                       61.16n ±  1%    62.74n ± 2%  +2.60% (p=0.000 n=10)
ParseFeatureExtAck_Empty-4            34.44n ±  2%    34.74n ± 1%       ~ (p=0.043 n=10)
ParseTabName-4                        51.42n ±  1%    52.84n ± 1%  +2.76% (p=0.000 n=10)
ParseColInfo-4                        51.24n ±  0%    51.74n ± 1%       ~ (p=0.060 n=10)
ReadFixedType_Int64-4                 23.60n ±  2%    23.70n ± 1%       ~ (p=0.926 n=10)
ReadFixedType_Int32-4                 13.47n ±  1%    14.21n ± 1%  +5.49% (p=0.000 n=10)
ReadFixedType_Float64-4               23.56n ±  2%    23.46n ± 1%       ~ (p=0.382 n=10)
ReadFixedType_DateTime-4              47.36n ±  1%    48.37n ± 2%  +2.12% (p=0.000 n=10)
ReadByteLenType_IntN_8-4              23.92n ±  1%    23.89n ± 2%       ~ (p=0.516 n=10)
ReadByteLenType_IntN_4-4              23.31n ±  2%    24.54n ± 1%  +5.25% (p=0.000 n=10)
ReadByteLenType_FloatN_8-4            22.82n ±  1%    23.63n ± 1%  +3.53% (p=0.000 n=10)
ReadByteLenType_BitN-4                12.51n ±  3%    13.09n ± 1%  +4.63% (p=0.000 n=10)
ReadByteLenType_Null-4                4.569n ±  2%    4.633n ± 2%       ~ (p=0.072 n=10)
ReadShortLenType_NVarChar_Short-4     49.43n ±  2%    51.89n ± 1%  +4.99% (p=0.000 n=10)
ReadShortLenType_NVarChar_Medium-4    78.40n ±  1%    82.65n ± 1%  +5.41% (p=0.000 n=10)
ReadShortLenType_VarBinary-4          60.83n ±  1%    62.95n ± 2%  +3.49% (p=0.001 n=10)
ReadByteLenType_VarChar-4             97.95n ±  4%   103.50n ± 2%  +5.67% (p=0.000 n=10)
DecodeDateTime-4                      34.47n ±  1%    36.12n ± 1%  +4.79% (p=0.000 n=10)
DecodeDateTim4-4                      32.97n ±  1%    34.25n ± 1%  +3.90% (p=0.000 n=10)
EncodeDateTime-4                      62.44n ±  4%    65.90n ± 2%  +5.54% (p=0.000 n=10)
geomean                               234.1n          235.4n       +0.59%

               │ bench_old.txt │            bench_new.txt            │
               │      B/s      │     B/s       vs base               │
TdsBuffer_Write_Small-4     6.369Gi ± 2%   6.494Gi ± 1%  +1.97% (p=0.002 n=10)
TdsBuffer_Write_Medium-4    48.66Gi ± 2%   50.58Gi ± 2%  +3.93% (p=0.000 n=10)
TdsBuffer_Write_Large-4     95.73Gi ± 1%   97.44Gi ± 2%  +1.78% (p=0.000 n=10)
TdsBuffer_Read_Small-4      7.727Gi ± 2%   7.841Gi ± 2%       ~ (p=0.035 n=10)
Str2ucs2_Short-4            66.96Mi ± 2%   65.63Mi ± 1%  -1.99% (p=0.003 n=10)
Str2ucs2_Medium-4           146.6Mi ± 3%   149.0Mi ± 2%       ~ (p=0.393 n=10)
Str2ucs2_Long-4             164.3Mi ± 3%   162.5Mi ± 2%       ~ (p=0.165 n=10)
Ucs22str_ASCII-4            1.253Gi ± 2%   1.207Gi ± 2%  -3.71% (p=0.000 n=10)
Ucs22str_Unicode-4          244.6Mi ± 2%   237.0Mi ± 2%  -3.10% (p=0.001 n=10)
Ucs22str_LongASCII-4        2.407Gi ± 1%   2.359Gi ± 1%  -1.98% (p=0.000 n=10)
geomean                     1.736Gi        1.733Gi       -0.14%

                         │ bench_old.txt  │             bench_new.txt             │
                         │      B/op      │     B/op      vs base                 │
TdsBuffer_Write_Small-4                0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Write_Medium-4               0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Write_Large-4                0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_WriteByte-4                  0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Read_Small-4                 0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_ReadByte-4                   0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Uint16-4                     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Uint32-4                     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Uint64-4                     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_BeginFinishPacket-4          0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadBVarCharOrPanicWideChars-4         72.00 ± 0%       72.00 ± 0%       ~ (p=1.000 n=10) ¹
ReadBVarCharOrPanicOnly1WideChar-4     97.00 ± 0%       97.00 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_Int64-4                  8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_Int32-4                  4.000 ± 0%       4.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_Float64-4                8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_String_NVarChar-4        304.0 ± 0%       304.0 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_String_VarChar-4         48.00 ± 0%       48.00 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_DateTime-4               32.00 ± 0%       32.00 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_DateTime2-4              32.00 ± 0%       32.00 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_Bool-4                   1.000 ± 0%       1.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_MultiColumn-4            72.00 ± 0%       72.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_StringToString-4         16.00 ± 0%       16.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_StringToBytes-4          72.00 ± 0%       72.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_BytesToString-4          88.00 ± 0%       88.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_BytesToBytes-4           96.00 ± 0%       96.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_Int64ToInt64-4           8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_Int64ToString-4          32.00 ± 0%       32.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_Float64ToFloat64-4       8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_TimeToTime-4             48.00 ± 0%       48.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_TimeToString-4           72.00 ± 0%       72.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_NilToBytes-4             24.00 ± 0%       24.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_Int64ToInterface-4       16.00 ± 0%       16.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_StringToRawBytes-4       72.00 ± 0%       72.00 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_BoolToBool-4             1.000 ± 0%       1.000 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_ConnectDisconnect-4        156.2Ki ± 4%     161.2Ki ± 3%       ~ (p=0.143 n=10)
RoundTrip_Select1-4                  2.586Ki ± 0%     2.586Ki ± 0%       ~ (p=1.000 n=10)
RoundTrip_ParamQuery-4               5.767Ki ± 0%     5.767Ki ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_MultiRow-4                 37.20Ki ± 0%     37.20Ki ± 0%       ~ (p=0.250 n=10)
RoundTrip_LargeResultSet-4           277.3Ki ± 0%     277.3Ki ± 0%       ~ (p=0.751 n=10)
RoundTrip_ExecInsert-4               6.110Ki ± 0%     6.110Ki ± 0%       ~ (p=0.628 n=10)
RoundTrip_StoredProc-4               5.384Ki ± 0%     5.384Ki ± 0%       ~ (p=0.303 n=10)
RoundTrip_Transaction-4              7.433Ki ± 0%     7.432Ki ± 0%       ~ (p=1.000 n=10)
RoundTrip_BulkInsert/Rows_100-4      72.28Ki ± 0%     72.29Ki ± 0%       ~ (p=0.493 n=10)
RoundTrip_BulkInsert/Rows_1000-4     582.3Ki ± 0%     582.3Ki ± 0%       ~ (p=0.050 n=10)
RoundTrip_ConcurrentQueries-4        2.626Ki ± 0%     2.629Ki ± 0%       ~ (p=0.113 n=10)
RoundTrip_MixedTypes-4               6.626Ki ± 0%     6.627Ki ± 0%       ~ (p=0.370 n=10)
RoundTrip_LargePayload-4             134.7Ki ± 0%     134.7Ki ± 0%       ~ (p=0.470 n=10)
RoundTrip_PreparedStmt-4             5.438Ki ± 0%     5.438Ki ± 0%       ~ (p=0.474 n=10)
RoundTrip_MessageQuery-4             13.75Ki ± 0%     13.75Ki ± 0%       ~ (p=0.382 n=10)
WriteTypeInfo_Int8-4                   2.000 ± 0%       2.000 ± 0%       ~ (p=1.000 n=10) ¹
WriteTypeInfo_NVarChar-4               8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
WriteTypeInfo_NVarCharMax-4            8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
WriteByteLenType-4                     1.000 ± 0%       1.000 ± 0%       ~ (p=1.000 n=10) ¹
WriteShortLenType-4                    2.000 ± 0%       2.000 ± 0%       ~ (p=1.000 n=10) ¹
WritePLPType_Short-4                   16.00 ± 0%       16.00 ± 0%       ~ (p=1.000 n=10) ¹
SendRpc_SingleIntParam-4             64.21Ki ± 0%     64.21Ki ± 0%       ~ (p=1.000 n=10)
Str2ucs2_Short-4                       56.00 ± 0%       56.00 ± 0%       ~ (p=1.000 n=10) ¹
Str2ucs2_Medium-4                      152.0 ± 0%       152.0 ± 0%       ~ (p=1.000 n=10) ¹
Str2ucs2_Long-4                        856.0 ± 0%       856.0 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22str_ASCII-4                       64.00 ± 0%       64.00 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22str_Unicode-4                     72.00 ± 0%       72.00 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22str_LongASCII-4                   144.0 ± 0%       144.0 ± 0%       ~ (p=1.000 n=10) ¹
ManglePassword_Short-4                 56.00 ± 0%       56.00 ± 0%       ~ (p=1.000 n=10) ¹
ManglePassword_Long-4                  408.0 ± 0%       408.0 ± 0%       ~ (p=1.000 n=10) ¹
SendLogin-4                            448.0 ± 0%       448.0 ± 0%       ~ (p=1.000 n=10) ¹
WritePrelogin-4                        50.00 ± 0%       50.00 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strAscii-4                        3.000 ± 0%       3.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strMediumAscii-4                  16.00 ± 0%       16.00 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strLongAscii-4                    64.00 ± 0%       64.00 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strLongerAscii-4                  640.0 ± 0%       640.0 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strTrailingUnicode-4              48.00 ± 0%       48.00 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strLongEmojis-4                   128.0 ± 0%       128.0 ± 0%       ~ (p=1.000 n=10) ¹
ParseDone-4                            0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseDoneInProc-4                      0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseReturnStatus-4                    0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseOrder-4                           8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseError72-4                         128.0 ± 0%       128.0 ± 0%       ~ (p=1.000 n=10) ¹
ParseInfo-4                            160.0 ± 0%       160.0 ± 0%       ~ (p=1.000 n=10) ¹
ParseLoginAck-4                        88.00 ± 0%       88.00 ± 0%       ~ (p=1.000 n=10) ¹
ParseFeatureExtAck_Empty-4             48.00 ± 0%       48.00 ± 0%       ~ (p=1.000 n=10) ¹
ParseTabName-4                         24.00 ± 0%       24.00 ± 0%       ~ (p=1.000 n=10) ¹
ParseColInfo-4                         24.00 ± 0%       24.00 ± 0%       ~ (p=1.000 n=10) ¹
ReadFixedType_Int64-4                  8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadFixedType_Int32-4                  0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadFixedType_Float64-4                8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadFixedType_DateTime-4               24.00 ± 0%       24.00 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_IntN_8-4               8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_IntN_4-4               8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_FloatN_8-4             8.000 ± 0%       8.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_BitN-4                 0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_Null-4                 0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadShortLenType_NVarChar_Short-4      21.00 ± 0%       21.00 ± 0%       ~ (p=1.000 n=10) ¹
ReadShortLenType_NVarChar_Medium-4     80.00 ± 0%       80.00 ± 0%       ~ (p=1.000 n=10) ¹
ReadShortLenType_VarBinary-4           88.00 ± 0%       88.00 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_VarChar-4              32.00 ± 0%       32.00 ± 0%       ~ (p=1.000 n=10) ¹
DecodeDateTime-4                       24.00 ± 0%       24.00 ± 0%       ~ (p=1.000 n=10) ¹
DecodeDateTim4-4                       24.00 ± 0%       24.00 ± 0%       ~ (p=1.000 n=10) ¹
EncodeDateTime-4                       32.00 ± 0%       32.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                           ²                 +0.03%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                         │ bench_old.txt │            bench_new.txt             │
                         │   allocs/op   │  allocs/op   vs base                 │
TdsBuffer_Write_Small-4               0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Write_Medium-4              0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Write_Large-4               0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_WriteByte-4                 0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Read_Small-4                0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_ReadByte-4                  0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Uint16-4                    0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Uint32-4                    0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_Uint64-4                    0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TdsBuffer_BeginFinishPacket-4         0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadBVarCharOrPanicWideChars-4        4.000 ± 0%      4.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadBVarCharOrPanicOnly1WideChar-4    4.000 ± 0%      4.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_Int64-4                 1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_Int32-4                 1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_Float64-4               1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_String_NVarChar-4       3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_String_VarChar-4        1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_DateTime-4              2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_DateTime2-4             2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_Bool-4                  1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
BulkMakeParam_MultiColumn-4           5.000 ± 0%      5.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_StringToString-4        1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_StringToBytes-4         2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_BytesToString-4         3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_BytesToBytes-4          3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_Int64ToInt64-4          1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_Int64ToString-4         2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_Float64ToFloat64-4      1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_TimeToTime-4            2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_TimeToString-4          3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_NilToBytes-4            1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_Int64ToInterface-4      1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_StringToRawBytes-4      2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ConvertAssign_BoolToBool-4            1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_ConnectDisconnect-4         750.0 ± 1%      750.0 ± 0%       ~ (p=0.650 n=10)
RoundTrip_Select1-4                   47.00 ± 0%      47.00 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_ParamQuery-4                116.0 ± 0%      116.0 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_MultiRow-4                 1.354k ± 0%     1.354k ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_LargeResultSet-4           10.05k ± 0%     10.05k ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_ExecInsert-4                102.0 ± 0%      102.0 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_StoredProc-4                94.00 ± 0%      94.00 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_Transaction-4               138.0 ± 0%      138.0 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_BulkInsert/Rows_100-4      2.113k ± 0%     2.113k ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_BulkInsert/Rows_1000-4     21.45k ± 0%     21.45k ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_ConcurrentQueries-4         47.00 ± 0%      47.00 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_MixedTypes-4                72.00 ± 0%      72.00 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_LargePayload-4              110.0 ± 0%      110.0 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_PreparedStmt-4              103.0 ± 0%      103.0 ± 0%       ~ (p=1.000 n=10) ¹
RoundTrip_MessageQuery-4              215.0 ± 0%      215.0 ± 0%       ~ (p=1.000 n=10) ¹
WriteTypeInfo_Int8-4                  2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
WriteTypeInfo_NVarChar-4              4.000 ± 0%      4.000 ± 0%       ~ (p=1.000 n=10) ¹
WriteTypeInfo_NVarCharMax-4           4.000 ± 0%      4.000 ± 0%       ~ (p=1.000 n=10) ¹
WriteByteLenType-4                    1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
WriteShortLenType-4                   1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
WritePLPType_Short-4                  3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
SendRpc_SingleIntParam-4              17.00 ± 0%      17.00 ± 0%       ~ (p=1.000 n=10) ¹
Str2ucs2_Short-4                      3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
Str2ucs2_Medium-4                     3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
Str2ucs2_Long-4                       4.000 ± 0%      4.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22str_ASCII-4                      2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22str_Unicode-4                    3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22str_LongASCII-4                  2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ManglePassword_Short-4                3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=10) ¹
ManglePassword_Long-4                 4.000 ± 0%      4.000 ± 0%       ~ (p=1.000 n=10) ¹
SendLogin-4                           15.00 ± 0%      15.00 ± 0%       ~ (p=1.000 n=10) ¹
WritePrelogin-4                       12.00 ± 0%      12.00 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strAscii-4                       1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strMediumAscii-4                 1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strLongAscii-4                   1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strLongerAscii-4                 1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strTrailingUnicode-4             2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
Ucs22strLongEmojis-4                  2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseDone-4                           0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseDoneInProc-4                     0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseReturnStatus-4                   0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseOrder-4                          1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseError72-4                        7.000 ± 0%      7.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseInfo-4                           7.000 ± 0%      7.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseLoginAck-4                       2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseFeatureExtAck_Empty-4            1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseTabName-4                        1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ParseColInfo-4                        1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadFixedType_Int64-4                 1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadFixedType_Int32-4                 0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadFixedType_Float64-4               1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadFixedType_DateTime-4              1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_IntN_8-4              1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_IntN_4-4              1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_FloatN_8-4            1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_BitN-4                0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_Null-4                0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadShortLenType_NVarChar_Short-4     2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadShortLenType_NVarChar_Medium-4    2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadShortLenType_VarBinary-4          2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
ReadByteLenType_VarChar-4             2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
DecodeDateTime-4                      1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
DecodeDateTim4-4                      1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=10) ¹
EncodeDateTime-4                      2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                          ²                +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/microsoft/go-mssqldb/msdsn
             │ bench_old.txt │           bench_new.txt            │
             │    sec/op     │   sec/op     vs base               │
Parse_URL-4                2.904µ ± 2%   3.074µ ± 1%  +5.84% (p=0.000 n=10)
Parse_URL_Azure-4          3.627µ ± 2%   3.733µ ± 1%  +2.92% (p=0.000 n=10)
Parse_ADO-4                3.642µ ± 1%   3.757µ ± 1%  +3.14% (p=0.000 n=10)
Parse_URL_Minimal-4        1.849µ ± 1%   1.927µ ± 1%  +4.27% (p=0.000 n=10)
Parse_URL_ManyParams-4     5.704µ ± 1%   5.987µ ± 1%  +4.96% (p=0.000 n=10)
geomean                    3.322µ        3.462µ       +4.22%

             │ bench_old.txt │             bench_new.txt             │
             │     B/op      │     B/op      vs base                 │
Parse_URL-4               2.047Ki ± 0%   2.047Ki ± 0%       ~ (p=1.000 n=10) ¹
Parse_URL_Azure-4         2.680Ki ± 0%   2.680Ki ± 0%       ~ (p=1.000 n=10) ¹
Parse_ADO-4               2.547Ki ± 0%   2.547Ki ± 0%       ~ (p=1.000 n=10) ¹
Parse_URL_Minimal-4       1.625Ki ± 0%   1.625Ki ± 0%       ~ (p=1.000 n=10) ¹
Parse_URL_ManyParams-4    4.695Ki ± 0%   4.695Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                   2.544Ki        2.544Ki       +0.00%
¹ all samples are equal

             │ bench_old.txt │            bench_new.txt            │
             │   allocs/op   │ allocs/op   vs base                 │
Parse_URL-4                 22.00 ± 0%   22.00 ± 0%       ~ (p=1.000 n=10) ¹
Parse_URL_Azure-4           26.00 ± 0%   26.00 ± 0%       ~ (p=1.000 n=10) ¹
Parse_ADO-4                 42.00 ± 0%   42.00 ± 0%       ~ (p=1.000 n=10) ¹
Parse_URL_Minimal-4         16.00 ± 0%   16.00 ± 0%       ~ (p=1.000 n=10) ¹
Parse_URL_ManyParams-4      41.00 ± 0%   41.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                     27.51        27.51       +0.00%
¹ all samples are equal

Generated by CI — commit 56df0f6

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.61%. Comparing base (802d9f1) to head (f83b0c4).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #417      +/-   ##
==========================================
+ Coverage   81.47%   81.61%   +0.13%     
==========================================
  Files          35       35              
  Lines        6926     6929       +3     
==========================================
+ Hits         5643     5655      +12     
+ Misses       1011     1005       -6     
+ Partials      272      269       -3     
Files with missing lines Coverage Δ
tds.go 74.97% <100.00%> (+1.05%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants