Commit b9e20027 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: only do work when needed

parent 12c3d1e1
......@@ -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))
{
/*
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment