Skip to content

Commit

Permalink
cleanup: only do work when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Sep 5, 2021
1 parent 12c3d1e commit b9e2002
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sql/item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2384,10 +2384,6 @@ left_is_superset(const DTCollation *left, const DTCollation *right)

bool DTCollation::aggregate(const DTCollation &dt, uint flags)
{

THD *thd = current_thd;
myf utf8_flag= thd ? thd->get_utf8_flag() :
global_system_variables.old_behavior & OLD_MODE_UTF8_IS_UTF8MB3;
if (!my_charset_same(collation, dt.collation))
{
/*
Expand Down Expand Up @@ -2475,6 +2471,9 @@ bool DTCollation::aggregate(const DTCollation &dt, uint flags)
set(dt);
return 0;
}
THD *thd = current_thd;
myf utf8_flag= thd ? thd->get_utf8_flag()
: global_system_variables.old_behavior & OLD_MODE_UTF8_IS_UTF8MB3;
CHARSET_INFO *bin= get_charset_by_csname(collation->cs_name.str,
MY_CS_BINSORT,MYF(utf8_flag));
set(bin, DERIVATION_NONE);
Expand Down

0 comments on commit b9e2002

Please sign in to comment.