Skip to content

fix: avoid panic on empty arguments (#826) - #829

Open
Matteo Scaramuccia (scara) wants to merge 1 commit into
microsoft:mainfrom
scara:fix/826-empty-arguments
Open

Matteo Scaramuccia (scara) wants to merge 1 commit into
microsoft:mainfrom
scara:fix/826-empty-arguments

Conversation

@scara

@scara Matteo Scaramuccia (scara) commented Nov 14, 2026 •

Copy link
Copy Markdown

Minimal fix proposal, including a regression test addressing #826.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change addressing empty-argument panics in sqlcmd.

No open issues 🎉

What changed in this PR

This PR prevents panics when sqlcmd processes empty command-line arguments, with a minimal change to argument normalization and regression tests.

Changes:

  • Guard flag detection against empty strings and reuse it when checking optional flag defaults.
  • Add tests for empty argument values and existing optional-default behavior.
File Description
cmd/​sqlcmd/​sqlcmd.go Safely handles empty strings during flag detection and optional-value checks.
cmd/​sqlcmd/​sqlcmd_test.go Adds regression coverage for empty connection, list, optional, and standalone arguments.

Review effort: Balanced

@scara

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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