Skip to content

Commit

Permalink
MDEV-22740: UBSAN: sql/opt_split.cc:1150:28: runtime error: shift exp…
Browse files Browse the repository at this point in the history
…onent 61 is too large for 32-bit type 'int' (on optimized builds)

Use a ulonglong instead of uint when left shifting to calculate the table map for all the tables in a query
  • Loading branch information
Varun Gupta committed Dec 14, 2020
1 parent 18256bc commit e5d88e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/opt_split.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ bool JOIN_TAB::fix_splitting(SplM_plan_info *spl_plan,
bool JOIN::fix_all_splittings_in_plan()
{
table_map prev_tables= 0;
table_map all_tables= (1 << table_count) - 1;
table_map all_tables= (table_map(1) << table_count) - 1;
for (uint tablenr= 0; tablenr < table_count; tablenr++)
{
POSITION *cur_pos= &best_positions[tablenr];
Expand Down

0 comments on commit e5d88e0

Please sign in to comment.