1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge with 4.1 tree to get fix for INSERT IGNORE ... ON DUPLICATE KEY

BitKeeper/etc/ignore:
  auto-union
BitKeeper/etc/logging_ok:
  auto-union
Makefile.am:
  Auto merged
client/mysqltest.c:
  Auto merged
configure.in:
  Auto merged
innobase/log/log0recv.c:
  Auto merged
myisam/mi_check.c:
  Auto merged
mysql-test/r/cast.result:
  Auto merged
mysql-test/r/drop.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/t/drop.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
ndb/include/ndb_global.h.in:
  Auto merged
ndb/src/kernel/blocks/suma/Suma.cpp:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_repl.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/time.cc:
  Auto merged
innobase/row/row0upd.c:
  Trivial merge
mysql-test/t/func_concat.test:
  Keep local code
mysql-test/t/multi_update.test:
  auto merge
sql/ha_ndbcluster.cc:
  manual merge
sql/item_timefunc.cc:
  manual merge
sql/mysql_priv.h:
  manual merge
sql/sql_class.h:
  manual merge
sql/sql_delete.cc:
  manual merge
sql/sql_insert.cc:
  manual merge
sql/sql_lex.cc:
  manual merge
sql/sql_lex.h:
  manual merge
sql/sql_load.cc:
  manual merge
sql/sql_parse.cc:
  manual merge
sql/sql_table.cc:
  manual merge
sql/sql_update.cc:
  manual merge
This commit is contained in:
unknown
2005-01-03 23:04:52 +02:00
53 changed files with 3551 additions and 157 deletions

View File

@ -36,6 +36,7 @@ static char *make_unique_key_name(const char *field_name,KEY *start,KEY *end);
static int copy_data_between_tables(TABLE *from,TABLE *to,
List<create_field> &create,
enum enum_duplicates handle_duplicates,
bool ignore,
uint order_num, ORDER *order,
ha_rows *copied,ha_rows *deleted);
@ -2806,7 +2807,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
TABLE_LIST *table_list,
List<create_field> &fields, List<Key> &keys,
uint order_num, ORDER *order,
enum enum_duplicates handle_duplicates,
enum enum_duplicates handle_duplicates, bool ignore,
ALTER_INFO *alter_info, bool do_send_ok)
{
TABLE *table,*new_table=0;
@ -3348,7 +3349,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
new_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
new_table->next_number_field=new_table->found_next_number_field;
error=copy_data_between_tables(table,new_table,create_list,
handle_duplicates,
handle_duplicates, ignore,
order_num, order, &copied, &deleted);
}
thd->last_insert_id=next_insert_id; // Needed for correct log
@ -3567,6 +3568,7 @@ static int
copy_data_between_tables(TABLE *from,TABLE *to,
List<create_field> &create,
enum enum_duplicates handle_duplicates,
bool ignore,
uint order_num, ORDER *order,
ha_rows *copied,
ha_rows *deleted)
@ -3660,7 +3662,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
current query id */
from->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1,1);
if (handle_duplicates == DUP_IGNORE ||
if (ignore ||
handle_duplicates == DUP_REPLACE)
to->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
thd->row_count= 0;
@ -3686,7 +3688,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
}
if ((error=to->file->write_row((byte*) to->record[0])))
{
if ((handle_duplicates != DUP_IGNORE &&
if ((!ignore &&
handle_duplicates != DUP_REPLACE) ||
(error != HA_ERR_FOUND_DUPP_KEY &&
error != HA_ERR_FOUND_DUPP_UNIQUE))
@ -3764,7 +3766,7 @@ bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list,
DBUG_RETURN(mysql_alter_table(thd, NullS, NullS, &create_info,
table_list, lex->create_list,
lex->key_list, 0, (ORDER *) 0,
DUP_ERROR, &lex->alter_info, do_send_ok));
DUP_ERROR, 0, &lex->alter_info, do_send_ok));
}