From 7083e58e2e8c76e54f48591e545eb1ae7051fb33 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 16 May 2023 11:04:48 +0300 Subject: [PATCH] Fix UBSAN failure: sql_select.h:982:7: load of value ... not valid for type bool This is 11.0 part of the fix: in 11.0, get_costs_for_tables() calls best_access_path() for all possible tables, for each call it saves a POSITION object with the access method and "loose_scan_pos" POSITION object. The latter is saved even if there is no possible LooseScan plan. Saving is done by copying POSITION objects which may generate a spurious UBSan error. --- sql/sql_select.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cec3aa1f91f..9d1987a6369 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -449,6 +449,7 @@ POSITION::POSITION() key= 0; forced_index= 0; use_join_buffer= 0; + firstmatch_with_join_buf= false; sj_strategy= SJ_OPT_NONE; n_sj_tables= 0; spl_plan= 0;