Commit db018233 authored by unknown's avatar unknown

Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint

into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint


client/mysql.cc:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
vio/viosocket.c:
  Auto merged
mysql-test/r/ctype_recoding.result:
  Manual merge.
mysql-test/t/ctype_recoding.test:
  Manual merge.
parents 9111f711 5bd9bf55
...@@ -258,3 +258,4 @@ t1 CREATE TABLE `t1` ( ...@@ -258,3 +258,4 @@ t1 CREATE TABLE `t1` (
drop table t1; drop table t1;
create table t1(a char character set latin1 default _cp1251 0xFF); create table t1(a char character set latin1 default _cp1251 0xFF);
ERROR 42000: Invalid default value for 'a' ERROR 42000: Invalid default value for 'a'
End of 4.1 tests
...@@ -199,4 +199,4 @@ drop table t1; ...@@ -199,4 +199,4 @@ drop table t1;
--error 1067 --error 1067
create table t1(a char character set latin1 default _cp1251 0xFF); create table t1(a char character set latin1 default _cp1251 0xFF);
# End of 4.1 tests --echo End of 4.1 tests
...@@ -2225,30 +2225,30 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, ...@@ -2225,30 +2225,30 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
} }
/* /*
Convert the default value character Convert the default value from client character
set into the column character set if necessary. set into the column character set if necessary.
*/ */
if (sql_field->def && if (sql_field->def &&
savecs != sql_field->def->collation.collation && save_cs != sql_field->def->collation.collation &&
(sql_field->sql_type == FIELD_TYPE_VAR_STRING || (sql_field->sql_type == FIELD_TYPE_VAR_STRING ||
sql_field->sql_type == FIELD_TYPE_STRING || sql_field->sql_type == FIELD_TYPE_STRING ||
sql_field->sql_type == FIELD_TYPE_SET || sql_field->sql_type == FIELD_TYPE_SET ||
sql_field->sql_type == FIELD_TYPE_ENUM)) sql_field->sql_type == FIELD_TYPE_ENUM))
{ {
Item_arena backup_arena; Query_arena backup_arena;
bool need_to_change_arena= bool need_to_change_arena= !thd->stmt_arena->is_conventional();
!thd->current_arena->is_conventional_execution();
if (need_to_change_arena) if (need_to_change_arena)
{ {
/* Assert that we don't do that at every PS execute */ /* Asser that we don't do that at every PS execute */
DBUG_ASSERT(thd->current_arena->is_first_stmt_execute()); DBUG_ASSERT(thd->stmt_arena->is_first_stmt_execute() ||
thd->set_n_backup_item_arena(thd->current_arena, &backup_arena); 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(savecs); sql_field->def= sql_field->def->safe_charset_converter(save_cs);
if (need_to_change_arena) if (need_to_change_arena)
thd->restore_backup_item_arena(thd->current_arena, &backup_arena); thd->restore_active_arena(thd->stmt_arena, &backup_arena);
if (sql_field->def == NULL) if (sql_field->def == NULL)
{ {
......
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