fix: handle COLINFO (0xA5) and TABNAME (0xA4) TDS tokens returned by tables with triggers#343
Merged
Merged
Conversation
…triggers Agent-Logs-Url: https://github.com/microsoft/go-mssqldb/sessions/b95eb330-ed57-4d40-ba5b-7979e2daeae8 Co-authored-by: shueybubbles <2224906+shueybubbles@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix INSERT operation error with triggers on table
fix: handle COLINFO (0xA5) and TABNAME (0xA4) TDS tokens returned by tables with triggers
Mar 26, 2026
Collaborator
|
@copilot add a test |
…sSingleResponse integration test Agent-Logs-Url: https://github.com/microsoft/go-mssqldb/sessions/2c4e56ea-bbaf-416d-a069-a29c3dfa8498 Co-authored-by: shueybubbles <2224906+shueybubbles@users.noreply.github.com>
Author
Added three tests in commit c5663af:
|
shueybubbles
approved these changes
Mar 26, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #343 +/- ##
==========================================
+ Coverage 79.80% 79.91% +0.11%
==========================================
Files 34 34
Lines 6600 6623 +23
==========================================
+ Hits 5267 5293 +26
+ Misses 1062 1061 -1
+ Partials 271 269 -2
🚀 New features to boost your workflow:
|
|
@copilot that codecov report needs some work |
…token String() method Agent-Logs-Url: https://github.com/microsoft/go-mssqldb/sessions/a28943f0-dfb0-43f3-9ccd-ae25d1f0b2b6 Co-authored-by: dlevy-msft-sql <194277063+dlevy-msft-sql@users.noreply.github.com>
Author
Improved coverage in commit 5d70dde.
|
shueybubbles
approved these changes
Mar 26, 2026
dlevy-msft-sql
approved these changes
Mar 26, 2026
AbbasLB
pushed a commit
to AbbasLB/go-mssqldb
that referenced
this pull request
Apr 10, 2026
…tables with triggers (microsoft#343) * Initial plan * fix: handle COLINFO (0xA5) and TABNAME (0xA4) tokens for tables with triggers Agent-Logs-Url: https://github.com/microsoft/go-mssqldb/sessions/b95eb330-ed57-4d40-ba5b-7979e2daeae8 Co-authored-by: shueybubbles <2224906+shueybubbles@users.noreply.github.com> * test: add unit tests for COLINFO and TABNAME token parsing and processSingleResponse integration test Agent-Logs-Url: https://github.com/microsoft/go-mssqldb/sessions/2c4e56ea-bbaf-416d-a069-a29c3dfa8498 Co-authored-by: shueybubbles <2224906+shueybubbles@users.noreply.github.com> * test: improve coverage for parseColInfo/parseTabName error paths and token String() method Agent-Logs-Url: https://github.com/microsoft/go-mssqldb/sessions/a28943f0-dfb0-43f3-9ccd-ae25d1f0b2b6 Co-authored-by: dlevy-msft-sql <194277063+dlevy-msft-sql@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shueybubbles <2224906+shueybubbles@users.noreply.github.com> Co-authored-by: dlevy-msft-sql <194277063+dlevy-msft-sql@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tokenTabName(0xA4 = 164) andtokenColInfo(0xA5 = 165) token constants to token.goparseTabNamefunction that reads and discards the TABNAME token streamparseColInfofunction that reads and discards the COLINFO token streamprocessSingleResponseswitch statementtoken_string.goto include the new token namesTestParseColInfo— happy-path subtests (empty, with data) + "truncated stream panics" subtest for 100% coverage of parseColInfoTestParseTabName— happy-path subtests (empty, with data) + "truncated stream panics" subtest for 100% coverage of parseTabNameTestTokenString— verifiestokenTabName.String()andtokenColInfo.String()return the correct names, covering the new cases intoken_string.goTestProcessSingleResponseWithTriggerTableTokens— full integration test via real TDS packet✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.