Skip to content

Fix My SQL Tools Issues.#2677

Draft
g2vinay wants to merge 3 commits into
microsoft:mainfrom
g2vinay:fix-mysql-issues
Draft

Fix My SQL Tools Issues.#2677
g2vinay wants to merge 3 commits into
microsoft:mainfrom
g2vinay:fix-mysql-issues

Conversation

@g2vinay
Copy link
Copy Markdown
Contributor

@g2vinay g2vinay commented May 20, 2026

No description provided.

g2vinay added 3 commits May 19, 2026 17:21
- MY-02/04: Add subscription-wide ListServersInSubscriptionAsync; make
  --resource-group optional on 'azmcp mysql list', falling back to
  enumerating all servers across the subscription when omitted
- MY-03: Split MaxResultLimit into MaxRowCount and MaxQueryLengthChars
  so each limit can be tuned independently
- MY-06: Replace plain Exception with KeyNotFoundException for
  resource-group and parameter not-found cases so callers receive
  the correct HTTP 404 status code
- MY-07: Extract ValidateQuerySafety's inline compiled Regex to a
  private static readonly field (AOT-safe, compiled once)
- MY-08: Remove --user from ARM-only commands (ServerConfigGet,
  ServerParamGet, ServerParamSet, list without server); --user is now
  required only on data-plane commands (DatabaseQuery, TableSchemaGet)
  and optional on 'list' when --server is supplied
- MY-10: Seal MySqlService per project convention
- MY-11: Change MySqlListCommandResult and TableSchemaGetCommandResult
  from public to internal

Tests: update existing tests to match new signatures; add new tests for
subscription-wide listing, resource-group-not-found KeyNotFoundException,
ListServersInSubscriptionAsync error path, and --user validation
…isting

Replace the resource-group-iteration approach in ListServersInSubscriptionAsync
with the direct subscription-level ARM extension method, which maps to a single
REST call (GET /subscriptions/{id}/providers/Microsoft.DBforMySQL/flexibleServers)
instead of N+1 calls.
- section: "Bugs Fixed"
description: |
Fixed several issues in the MySQL toolset:
- `azmcp mysql list` no longer crashes when `--resource-group` is omitted. It now lists all MySQL servers across the subscription using a single ARM API call, matching the behavior of the PostgreSQL toolset.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `azmcp mysql list` no longer crashes when `--resource-group` is omitted. It now lists all MySQL servers across the subscription using a single ARM API call, matching the behavior of the PostgreSQL toolset.
- `azmcp mysql list` now works when `--resource-group` is omitted. It now lists all MySQL servers across the subscription using a single ARM API call, matching the behavior of the PostgreSQL toolset.

Let's use friendlier terminology 😄

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This class doesn't do anything now, just delete it.

if (tableCount >= MaxRowCount)
{
tables.Add($"... (output limited to {MaxResultLimit:N0} tables for security and performance reasons)");
tables.Add($"... (output limited to {MaxRowCount:N0} tables for security and performance reasons)");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems this should be returning a list of string for the tables and truncation information. This could errantly be interpreted as a table name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants