summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <jani@ua141d10.elisa.omakaista.fi>2006-06-01 20:39:12 +0300
committerunknown <jani@ua141d10.elisa.omakaista.fi>2006-06-01 20:39:12 +0300
commitae0f26c8648f0870c0d039d95b2fb0a63150c7f1 (patch)
tree802d23d218acf57d4a789cb1fb868630268ef72b /sql/sql_table.cc
parent1f5e0486d4ddb0082c2ee5b030cf658099a414e9 (diff)
parentcdd3536d88d6ef3755fd02e8e6746876daa4dc6a (diff)
downloadmariadb-git-ae0f26c8648f0870c0d039d95b2fb0a63150c7f1.tar.gz
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-new-marvel configure.in: Auto merged mysql-test/mysql-test-run.pl: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/item.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 64523ec6310..f28a70c05bc 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3897,6 +3897,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
*/
ha_autocommit_or_rollback(thd, 1);
close_thread_tables(thd);
+ lex->reset_query_tables_list(FALSE);
if (protocol->write())
goto err;
continue;
@@ -3922,6 +3923,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
protocol->store(buff, length, system_charset_info);
ha_autocommit_or_rollback(thd, 0);
close_thread_tables(thd);
+ lex->reset_query_tables_list(FALSE);
table->table=0; // For query cache
if (protocol->write())
goto err;
@@ -4674,7 +4676,8 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
HA_CREATE_INFO *create_info,
ALTER_INFO *alter_info, uint order_num,
uint *index_drop_buffer, uint *index_drop_count,
- uint *index_add_buffer, uint *index_add_count)
+ uint *index_add_buffer, uint *index_add_count,
+ bool varchar)
{
Field **f_ptr, *field;
uint changes= 0, tmp;
@@ -4709,7 +4712,8 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
create_info->used_fields & HA_CREATE_USED_CHARSET ||
create_info->used_fields & HA_CREATE_USED_DEFAULT_CHARSET ||
(alter_info->flags & (ALTER_RECREATE | ALTER_FOREIGN_KEY)) ||
- order_num)
+ order_num ||
+ (table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar))
DBUG_RETURN(ALTER_TABLE_DATA_CHANGED);
/*
@@ -4883,7 +4887,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
uint db_create_options, used_fields;
handlerton *old_db_type, *new_db_type;
uint need_copy_table= 0;
- bool no_table_reopen= FALSE;
+ bool no_table_reopen= FALSE, varchar= FALSE;
#ifdef WITH_PARTITION_STORAGE_ENGINE
uint fast_alter_partition= 0;
bool partition_changed= FALSE;
@@ -5118,6 +5122,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
Field **f_ptr,*field;
for (f_ptr=table->field ; (field= *f_ptr) ; f_ptr++)
{
+ if (field->type() == MYSQL_TYPE_STRING)
+ varchar= TRUE;
/* Check if field should be dropped */
Alter_drop *drop;
drop_it.rewind();
@@ -5453,7 +5459,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
key_info_buffer, key_count,
create_info, alter_info, order_num,
index_drop_buffer, &index_drop_count,
- index_add_buffer, &index_add_count);
+ index_add_buffer, &index_add_count,
+ varchar);
}
/*