diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2021-12-19 17:19:02 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2021-12-19 17:19:02 +0300 |
commit | 32692140e1a4f9aa87359f3ef6efe4a615119e71 (patch) | |
tree | 3db2fc477fa84e4b39ad67f63ecad57235b39539 /sql/sql_prepare.cc | |
parent | 946dafb260fc5683e1ec1410a801f2235ba2313a (diff) | |
download | mariadb-git-bb-10.6-mdev27306.tar.gz |
MDEV-27306: SET STATEMENT optimizer_trace=1 Doesn't save the tracebb-10.6-mdev27306
In mysql_execute_command(), move optimizer trace initialization to be
after run_set_statement_if_requested() call.
Unfortunately, mysql_execute_command() code uses "goto error" a lot, and
this means optimizer trace code cannot use RAII objects. Work this around
by:
- Make Opt_trace_start a non-RAII object, add init() method.
- Move the code that writes the top-level object and array into
Opt_trace_start::init().
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 4ead77c225f..67032142591 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2437,9 +2437,9 @@ static bool check_prepared_statement(Prepared_statement *stmt) For the optimizer trace, this is the symmetric, for statement preparation, of what is done at statement execution (in mysql_execute_command()). */ - Opt_trace_start ots(thd, tables, lex->sql_command, &lex->var_list, - thd->query(), thd->query_length(), - thd->variables.character_set_client); + Opt_trace_start ots(thd); + ots.init(thd, tables, lex->sql_command, &lex->var_list, thd->query(), + thd->query_length(), thd->variables.character_set_client); Json_writer_object trace_command(thd); Json_writer_array trace_command_steps(thd, "steps"); |