microsoft / microsoft/go-sqlcmd

Ensure sqlcmd query doesn't return error after sqlcmd start

Open
#209 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ADS bug
Dominant language
Go
Stars
595
Forks
91
Avg merge
9h 35m
Merged PRs (30d)
1

Description

Right now sqlcmd start does not block waiting for SQL Server to be running and ready for client connections.

So if sqlcmd query is immediately run, it will fail with:

C:\src\go-sqlcmd\cmd\modern>sqlcmd query
EOF
Error: EOF

We either need to make sqlcmd start have a blocking option so it doesn't return until SQL is ready for connections, or sqlcmd query and sqlcmd open ads etc. all block waiting for connection to succeed (up to timeout)

As part of testing, I have tried blocking sqlcmd start until the errorlog prints "recovery complete" which is the last entry in a normal successful start up, and sqlcmd query still fails with the above error message for a few seconds.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sqlcmd start and sqlcmd query entry points and reproduce the immediate start-then-query sequence against SQL Server. Determine whether readiness belongs in start or in client commands, then verify that queries and related commands wait appropriately and succeed once connections are ready, without exceeding the timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
cli, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.