mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge dl145k.mysql.com:/data0/mkindahl/bkroot/mysql-5.1-new-rpl
into dl145k.mysql.com:/data0/mkindahl/bk/MERGE/mysql-5.1-merge include/my_sys.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/rpl_row_create_table.result: Auto merged mysql-test/t/disabled.def: Auto merged mysql-test/t/rpl_row_create_table.test: Auto merged mysys/my_malloc.c: Auto merged server-tools/instance-manager/parse.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.h: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_view.cc: Auto merged sql/sql_yacc.yy: Auto merged mysys/safemalloc.c: Merge of mysql-5.1-new-rpl into mysql-5.1 sql/ha_federated.cc: d Merge of mysql-5.1-new-rpl into mysql-5.1 sql/set_var.cc: Merge of mysql-5.1-new-rpl with mysql-5.1 sql/slave.cc: Merge of mysql-5.1-new-rpl into mysql-5.1 sql/sql_class.h: Merge of mysql-5.1-new-rpl into mysql-5.1
This commit is contained in:
@@ -4967,7 +4967,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
char path[FN_REFLEN];
|
||||
char reg_path[FN_REFLEN+1];
|
||||
ha_rows copied,deleted;
|
||||
ulonglong next_insert_id;
|
||||
uint db_create_options, used_fields;
|
||||
handlerton *old_db_type, *new_db_type;
|
||||
HA_CREATE_INFO *create_info;
|
||||
@@ -5787,7 +5786,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields
|
||||
thd->cuted_fields=0L;
|
||||
thd->proc_info="copy to tmp table";
|
||||
next_insert_id=thd->next_insert_id; // Remember for logging
|
||||
copied=deleted=0;
|
||||
if (new_table && !(new_table->file->ha_table_flags() & HA_NO_COPY_ON_ALTER))
|
||||
{
|
||||
@@ -5798,7 +5796,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
handle_duplicates, ignore,
|
||||
order_num, order, &copied, &deleted);
|
||||
}
|
||||
thd->last_insert_id=next_insert_id; // Needed for correct log
|
||||
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
|
||||
|
||||
/* If we did not need to copy, we might still need to add/drop indexes. */
|
||||
@@ -6228,6 +6225,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
ha_rows examined_rows;
|
||||
bool auto_increment_field_copied= 0;
|
||||
ulong save_sql_mode;
|
||||
ulonglong prev_insert_id;
|
||||
DBUG_ENTER("copy_data_between_tables");
|
||||
|
||||
/*
|
||||
@@ -6334,6 +6332,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
{
|
||||
copy_ptr->do_copy(copy_ptr);
|
||||
}
|
||||
prev_insert_id= to->file->next_insert_id;
|
||||
if ((error=to->file->ha_write_row((byte*) to->record[0])))
|
||||
{
|
||||
if (!ignore || handle_duplicates != DUP_ERROR ||
|
||||
@@ -6357,7 +6356,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
to->file->print_error(error,MYF(0));
|
||||
break;
|
||||
}
|
||||
to->file->restore_auto_increment();
|
||||
to->file->restore_auto_increment(prev_insert_id);
|
||||
delete_count++;
|
||||
}
|
||||
else
|
||||
@@ -6391,6 +6390,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
free_io_cache(from);
|
||||
*copied= found_count;
|
||||
*deleted=delete_count;
|
||||
to->file->ha_release_auto_increment();
|
||||
if (to->file->ha_external_lock(thd,F_UNLCK))
|
||||
error=1;
|
||||
DBUG_RETURN(error > 0 ? -1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user