RAISERROR ('Message', 20, 1) WITH LOG causes SQLCMD to hang
まだ誰も着手していません。
評価
調査の方向性
まず、sysadmin アカウントを使って go-sqlcmd で RAISERROR ('Message', 20, 1) WITH LOG コマンドを再現し、次にその動作を ODBC sqlcmd と比較して、microsoft/go-sqlcmd#76 の部分的な解決を確認します。go-sqlcmd が SQL Server 接続の終了をどのように検出するかを追跡します。コマンドがハングするのではなく、致命的なエラーを報告して終了すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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!
- 主要言語
- Go
- スター
- 601
- フォーク
- 91
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/go-sqlcmd のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
-r discards the "Msg N, Level N, State N" error header — errors on stderr lose message number and line info再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
microsoft/go-sqlcmd の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
duplication
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openvibely/openvibely#1443 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
canonical/service-mesh#845 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
keyxmakerx/Chronicle#1179 ·
メンテナーはふだん 1 日以内に返信