[MDEV-27306] SET STATEMENT optimizer_trace=1 Doesn't save the trace Created: 2021-12-18  Updated: 2021-12-21  Resolved: 2021-12-20

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.8.0, 10.4.23, 10.5.14, 10.6.6, 10.7.2

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: optimizer_trace


 Description   

Suppose, one wants to produce trace for a statement.
One can do that with multiple statements:

set optimizer_trace=1;
select * from seq_1_to_10 where seq<10;
set optimizer_trace=0;

select left(trace, 100) from information_schema.optimizer_trace;

This produces a first part of the trace.

However, trying to do the same with SET STATEMENT produces an empty result:

set statement optimizer_trace=1 for select * from seq_1_to_10 where seq<10;
select left(trace, 100) from information_schema.optimizer_trace;

produces nothing.



 Comments   
Comment by Sergei Petrunia [ 2021-12-19 ]

bb-10.6-mdev27306, http://lists.askmonty.org/pipermail/commits/2021-December/014822.html

Comment by Sergei Petrunia [ 2021-12-20 ]

sanja, please review

Comment by Oleksandr Byelkin [ 2021-12-20 ]

I'd prefer that optimiser trace were done somewhere on lower level then mysql_execute_command, but that was done long time ago and fix it now is unreal. So patch is OK to push.

Generated at Thu Feb 08 09:51:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.