1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '5.5' into 10.0

This commit is contained in:
Sergei Golubchik
2016-02-15 22:50:59 +01:00
116 changed files with 2625 additions and 533 deletions

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
Copyright (c) 2010, 2016, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2253,7 +2253,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
const char *comment_start;
uint32 comment_len;
built_query.set_charset(system_charset_info);
built_query.set_charset(thd->charset());
if (if_exists)
built_query.append("DROP TABLE IF EXISTS ");
else
@@ -3474,8 +3474,31 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
else
{
/* Field redefined */
/*
If we are replacing a BIT field, revert the increment
of total_uneven_bit_length that was done above.
*/
if (sql_field->sql_type == MYSQL_TYPE_BIT &&
file->ha_table_flags() & HA_CAN_BIT_FIELD)
total_uneven_bit_length-= sql_field->length & 7;
sql_field->def= dup_field->def;
sql_field->sql_type= dup_field->sql_type;
/*
If we are replacing a field with a BIT field, we need
to initialize pack_flag. Note that we do not need to
increment total_uneven_bit_length here as this dup_field
has already been processed.
*/
if (sql_field->sql_type == MYSQL_TYPE_BIT)
{
sql_field->pack_flag= FIELDFLAG_NUMBER;
if (!(file->ha_table_flags() & HA_CAN_BIT_FIELD))
sql_field->pack_flag|= FIELDFLAG_TREAT_BIT_AS_CHAR;
}
sql_field->charset= (dup_field->charset ?
dup_field->charset :
create_info->default_table_charset);