MySQL: Support EXPLAIN ANALYZE format variants (#1945)
Some checks failed
license / Release Audit Tool (RAT) (push) Has been cancelled
Rust / codestyle (push) Has been cancelled
Rust / lint (push) Has been cancelled
Rust / benchmark-lint (push) Has been cancelled
Rust / compile (push) Has been cancelled
Rust / docs (push) Has been cancelled
Rust / compile-no-std (push) Has been cancelled
Rust / test (beta) (push) Has been cancelled
Rust / test (nightly) (push) Has been cancelled
Rust / test (stable) (push) Has been cancelled

This commit is contained in:
Yoav Cohen 2025-07-18 16:41:50 +03:00 committed by GitHub
parent 40bbcc9834
commit 23f40cdc40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 7 deletions

View file

@ -5161,7 +5161,7 @@ fn run_explain_analyze(
query: &str,
expected_verbose: bool,
expected_analyze: bool,
expected_format: Option<AnalyzeFormat>,
expected_format: Option<AnalyzeFormatKind>,
expected_options: Option<Vec<UtilityOption>>,
) {
match dialect.verified_stmt(query) {
@ -5272,7 +5272,7 @@ fn parse_explain_analyze_with_simple_select() {
"EXPLAIN ANALYZE FORMAT GRAPHVIZ SELECT sqrt(id) FROM foo",
false,
true,
Some(AnalyzeFormat::GRAPHVIZ),
Some(AnalyzeFormatKind::Keyword(AnalyzeFormat::GRAPHVIZ)),
None,
);
@ -5281,7 +5281,16 @@ fn parse_explain_analyze_with_simple_select() {
"EXPLAIN ANALYZE VERBOSE FORMAT JSON SELECT sqrt(id) FROM foo",
true,
true,
Some(AnalyzeFormat::JSON),
Some(AnalyzeFormatKind::Keyword(AnalyzeFormat::JSON)),
None,
);
run_explain_analyze(
all_dialects(),
"EXPLAIN ANALYZE VERBOSE FORMAT=JSON SELECT sqrt(id) FROM foo",
true,
true,
Some(AnalyzeFormatKind::Assignment(AnalyzeFormat::JSON)),
None,
);
@ -5290,7 +5299,7 @@ fn parse_explain_analyze_with_simple_select() {
"EXPLAIN VERBOSE FORMAT TEXT SELECT sqrt(id) FROM foo",
true,
false,
Some(AnalyzeFormat::TEXT),
Some(AnalyzeFormatKind::Keyword(AnalyzeFormat::TEXT)),
None,
);
}