RAISERROR ('Message', 20, 1) WITH LOG causes SQLCMD to hang
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
Research direction
Start by reproducing the RAISERROR ('Message', 20, 1) WITH LOG command in go-sqlcmd with a sysadmin account, then compare its behavior with ODBC sqlcmd and review the partial resolution in microsoft/go-sqlcmd#76. Trace how go-sqlcmd detects the SQL Server connection termination; done means the command reports the fatal error and exits instead of hanging.
Written by the indexing model from the issue text.
Description
When you execute the following command using a sysadmin account, SQLCMD hangs:
RAISERROR ('Message', 20, 1) WITH LOG
Noted this was mentioned in https://github.com/microsoft/go-sqlcmd/issues/76
That issue was closed with only a partial resolution to the issue.
Problem is caused by SQL Server forcibly terminating the connection - go-sqlcmd doesn't realise this has happened so gets into an undefined state and never exits.
"Severity levels from 20 through 25 are considered fatal. If a fatal severity level is encountered, the client connection is terminated after receiving the message, and the error is logged in the error and application logs."
Workaround for me is to set the third parameter of RAISERROR (state) to 127 rather than 1 - but I'd rather it worked the same as ODBC sqlcmd does!
- Dominant language
- Go
- Stars
- 595
- Forks
- 91
- Avg merge
- 9h 35m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/go-sqlcmd
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
All issues in microsoft/go-sqlcmd
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug group: validation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
codecheckers/chekhov#51 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100