1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge 10.5 into 10.6

This commit is contained in:
Marko Mäkelä
2022-09-20 16:53:20 +03:00
1152 changed files with 30607 additions and 29546 deletions

View File

@ -1453,7 +1453,7 @@ bool mysqld_show_create_db(THD *thd, LEX_CSTRING *dbname,
buffer.append(STRING_WITH_LEN(" /*!40100"));
buffer.append(STRING_WITH_LEN(" DEFAULT CHARACTER SET "));
buffer.append(create.default_table_charset->cs_name);
if (!(create.default_table_charset->state & MY_CS_PRIMARY))
if (Charset(create.default_table_charset).can_have_collate_clause())
{
buffer.append(STRING_WITH_LEN(" COLLATE "));
buffer.append(create.default_table_charset->coll_name);
@ -1913,7 +1913,7 @@ static void add_table_options(THD *thd, TABLE *table,
{
packet->append(STRING_WITH_LEN(" DEFAULT CHARSET="));
packet->append(share->table_charset->cs_name);
if (!(share->table_charset->state & MY_CS_PRIMARY))
if (Charset(table->s->table_charset).can_have_collate_clause())
{
packet->append(STRING_WITH_LEN(" COLLATE="));
packet->append(table->s->table_charset->coll_name);
@ -2199,20 +2199,11 @@ int show_create_table_ex(THD *thd, TABLE_LIST *table_list,
{
packet->append(STRING_WITH_LEN(" CHARACTER SET "));
packet->append(field->charset()->cs_name);
}
/*
For string types dump collation name only if
collation is not primary for the given charset
For generated fields don't print the COLLATE clause if
the collation matches the expression's collation.
*/
if (!(field->charset()->state & MY_CS_PRIMARY) &&
(!field->vcol_info ||
field->charset() != field->vcol_info->expr->collation.collation))
{
packet->append(STRING_WITH_LEN(" COLLATE "));
packet->append(field->charset()->coll_name);
if (Charset(field->charset()).can_have_collate_clause())
{
packet->append(STRING_WITH_LEN(" COLLATE "));
packet->append(field->charset()->coll_name);
}
}
}
@ -3591,6 +3582,7 @@ union Any_pointer {
@param variable [in] Details of the variable.
@param value_type [in] Variable type.
@param show_type [in] Variable show type.
@param status_var [in] Status variable pointer
@param charset [out] Character set of the value.
@param buff [in,out] Buffer to store the value.
(Needs to have enough memory