mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/usr/home/pem/mysql-5.1-new include/my_base.h: Auto merged libmysqld/examples/Makefile.am: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/ndb_alter_table.result: Auto merged mysql-test/r/ndb_basic.result: Auto merged mysql-test/t/ndb_alter_table.test: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged sql/examples/ha_example.cc: Auto merged storage/myisam/ft_parser.c: Auto merged storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged storage/ndb/src/mgmapi/mgmapi.cpp: Auto merged libmysqld/Makefile.am: Manual merge. sql/ha_ndbcluster.cc: Manual merge. sql/mysqld.cc: Manual merge.
This commit is contained in:
@@ -799,7 +799,14 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
*/
|
||||
if (!interval)
|
||||
{
|
||||
interval= sql_field->interval= typelib(sql_field->interval_list);
|
||||
/*
|
||||
Create the typelib in prepared statement memory if we're
|
||||
executing one.
|
||||
*/
|
||||
MEM_ROOT *stmt_root= thd->stmt_arena->mem_root;
|
||||
|
||||
interval= sql_field->interval= typelib(stmt_root,
|
||||
sql_field->interval_list);
|
||||
List_iterator<String> it(sql_field->interval_list);
|
||||
String conv, *tmp;
|
||||
for (uint i= 0; (tmp= it++); i++)
|
||||
@@ -810,7 +817,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
{
|
||||
uint cnv_errs;
|
||||
conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs);
|
||||
interval->type_names[i]= strmake_root(thd->mem_root, conv.ptr(),
|
||||
interval->type_names[i]= strmake_root(stmt_root, conv.ptr(),
|
||||
conv.length());
|
||||
interval->type_lengths[i]= conv.length();
|
||||
}
|
||||
@@ -830,8 +837,22 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
*/
|
||||
if (sql_field->def && cs != sql_field->def->collation.collation)
|
||||
{
|
||||
if (!(sql_field->def=
|
||||
sql_field->def->safe_charset_converter(cs)))
|
||||
Query_arena backup_arena;
|
||||
bool need_to_change_arena= !thd->stmt_arena->is_conventional();
|
||||
if (need_to_change_arena)
|
||||
{
|
||||
/* Asser that we don't do that at every PS execute */
|
||||
DBUG_ASSERT(thd->stmt_arena->is_first_stmt_execute() ||
|
||||
thd->stmt_arena->is_first_sp_execute());
|
||||
thd->set_n_backup_active_arena(thd->stmt_arena, &backup_arena);
|
||||
}
|
||||
|
||||
sql_field->def= sql_field->def->safe_charset_converter(cs);
|
||||
|
||||
if (need_to_change_arena)
|
||||
thd->restore_active_arena(thd->stmt_arena, &backup_arena);
|
||||
|
||||
if (! sql_field->def)
|
||||
{
|
||||
/* Could not convert */
|
||||
my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name);
|
||||
|
Reference in New Issue
Block a user