Confirm before executing a plan file's query against a server - #402
Merged
Conversation
"Get Actual Plan" on a loaded plan file prompted for a connection and then ran the query. The query-session path already confirmed first; this one did not, and it is the riskier of the two - the SQL comes out of a .sqlplan the user opened rather than something they typed, and plan files get emailed around. The dialog names the target server and database, so "which server was that?" is answered before the query runs rather than after. Extracts the dialog into Dialogs/ConfirmationDialog.cs instead of copying it. The two paths having separate implementations is how one of them ended up with no confirmation at all; DdlScripter has the same history of a duplicated helper drifting. QuerySessionControl now delegates to the shared version, so its behavior is unchanged. Verified: clean build 0 warnings, 202/202 tests, app launches and paints. AppButton resolves from Application.Resources, so looking it up from the owner window works the same as from the control. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the missing confirmation before "Get Actual Plan" executes a plan file's query against a live server. From the quarterly maintenance security review.
The gap
Two paths reach "execute this query to capture an actual plan":
QuerySessionControl.Execution.cs) - confirmed firstMainWindow.PlanViewer.cs) - prompted for a connection, then just ran itThe plan-file path is the riskier of the two. The SQL comes out of a
.sqlplanthe user opened rather than something they typed, and plan files get emailed around. So the one without a confirmation was the one that most needed it.The dialog
It names the target, because "which server was that?" should be answered before the query runs, not after:
Shared, not copied
The dialog moves to
Dialogs/ConfirmationDialog.csrather than being duplicated intoMainWindow. Two separate implementations is precisely how one path ended up with no confirmation at all - andDdlScripterin this repo carries a comment about the same thing happening to it ("previously duplicated in both controls' code-behind, where the two copies had drifted").QuerySessionControlnow delegates, so its behavior is unchanged.AppButtonlives inApplication.Resources(viaThemes/DarkTheme.axaml), so resolving it from the owner window works exactly as it did from the control - worth stating since a miss there would throw at runtime rather than at build.Test plan
awaiton the same helper.🤖 Generated with Claude Code