mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-17301 Change of COLLATE unnecessarily requires ALGORITHM=COPY
Patch is about two cases: 1) On some collate changes it's possible to rebuild only secondary indexes 2) For non-indexed columns collate can be changed INSTANTly Implemented mostly in Field_{string,varstring,blob}::is_equal(). Make this method return how exactly collationa differs. This information is later used by fill_alter_inplace_info() to pass correct info to engine.
This commit is contained in:
@ -8363,20 +8363,10 @@ Charset::encoding_allows_reinterpret_as(const CHARSET_INFO *cs) const
|
||||
|
||||
|
||||
bool
|
||||
Charset::encoding_and_order_allow_reinterpret_as(CHARSET_INFO *cs) const
|
||||
Charset::eq_collation_specific_names(CHARSET_INFO *cs) const
|
||||
{
|
||||
/*
|
||||
Test quickly if we have two exactly equal CHARSET_INFO pointers.
|
||||
This also handles a special case with my_charset_bin:
|
||||
it does not have a collation name specific part in CHARSET_INFO::name,
|
||||
which is just "binary" (without a character set name prefix),
|
||||
so the code with collation_specific_name() below won't work for it.
|
||||
*/
|
||||
if (m_charset == cs)
|
||||
return true;
|
||||
if (!encoding_allows_reinterpret_as(cs))
|
||||
return false;
|
||||
LEX_CSTRING name0= collation_specific_name();
|
||||
LEX_CSTRING name1= Charset(cs).collation_specific_name();
|
||||
/* Empty collations are not equal */
|
||||
return name0.length && !cmp(&name0, &name1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user