Skip to content

Commit 094f236

Browse files
committed
Bug#32855925: SELECT #2 WILL BE DISPLAYED TWICE WHEN WE EXPLAIN THE SQL
Post-push fix. ASan reported memory leaks from some EXPLAIN tests, such as main.explain_tree. The reason was that the Json_dom objects that were discarded to avoid describing a subquery twice, were not properly destroyed. The EXPLAIN code uses unique_ptr to make sure the Json_dom objects are destroyed, but there are windows in which the objects only exist as unmanaged raw pointers. This patch closes the window which caused this memory leak by changing ExplainChild::obj from a raw pointer to a unique_ptr, so that it gets destroyed even if it doesn't make it into the final tree that describes the full plan. Change-Id: I0f0885da867e8a34335ff11f3ae9da883a878ba4
1 parent ab5d892 commit 094f236

File tree

2 files changed

+134
-101
lines changed

2 files changed

+134
-101
lines changed

0 commit comments

Comments
 (0)