1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-22910: SIGSEGV in Opt_trace_context::is_started & SIGSEGV in Json_writer::add_table_name (on optimized builds)

Make sure to initialize members of TABLE::reginfo when TABLE::init is called. In this case the problem
was that table->reginfo.join_tab was set for the SELECT query and then was reused by the UPDATE query.
This case occurred only when the SELECT query had a degenerate join.
This commit is contained in:
Varun Gupta
2020-06-30 18:11:35 +05:30
parent 8e8f9671cb
commit cc0dca3663
4 changed files with 46 additions and 4 deletions

View File

@ -2690,10 +2690,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
DBUG_PRINT("info",("Time to scan table: %g", read_time));
Json_writer_object table_records(thd);
if (head->reginfo.join_tab)
table_records.add_table_name(head->reginfo.join_tab);
else
table_records.add_table_name(head);
table_records.add_table_name(head);
Json_writer_object trace_range(thd, "range_analysis");
{
Json_writer_object table_rec(thd, "table_scan");