1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1

into mysql.com:/Users/mikron/wl1682
This commit is contained in:
mronstrom@mysql.com
2005-05-07 11:23:09 +02:00
27 changed files with 930 additions and 312 deletions

View File

@@ -105,6 +105,11 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
#endif
clear_timestamp_auto_bits(table->timestamp_field_type,
TIMESTAMP_AUTO_SET_ON_INSERT);
/*
No fields are provided so all fields must be provided in the values.
Thus we set all bits in the write set.
*/
table->file->ha_set_all_bits_in_write_set();
}
else
{ // Part field list
@@ -120,7 +125,11 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
thd->lex->select_lex.no_wrap_view_item= 1;
save_next= table_list->next_local; // fields only from first table
table_list->next_local= 0;
res= setup_fields(thd, 0, table_list, fields, 1, 0, 0);
/*
Indicate fields in list is to be updated by setting set_query_id
parameter to 2. This sets the bit in the write_set for each field.
*/
res= setup_fields(thd, 0, table_list, fields, 2, 0, 0);
table_list->next_local= save_next;
thd->lex->select_lex.no_wrap_view_item= 0;
if (res)
@@ -209,9 +218,10 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
/*
Check the fields we are going to modify. This will set the query_id
of all used fields to the threads query_id.
of all used fields to the threads query_id. It will also set all
fields into the write set of this table.
*/
if (setup_fields(thd, 0, insert_table_list, update_fields, 1, 0, 0))
if (setup_fields(thd, 0, insert_table_list, update_fields, 2, 0, 0))
return -1;
if (table->timestamp_field)
@@ -221,7 +231,10 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
clear_timestamp_auto_bits(table->timestamp_field_type,
TIMESTAMP_AUTO_SET_ON_UPDATE);
else
{
table->timestamp_field->query_id= timestamp_query_id;
table->file->ha_set_bit_in_write_set(table->timestamp_field->fieldnr);
}
}
return 0;
@@ -788,7 +801,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
DBUG_RETURN(TRUE);
}
if (duplic == DUP_UPDATE || duplic == DUP_REPLACE)
table->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY);
table->file->ha_retrieve_all_pk();
thd->lex->select_lex.first_execution= 0;
DBUG_RETURN(FALSE);
}
@@ -1981,7 +1994,7 @@ select_insert::~select_insert()
if (table)
{
table->next_number_field=0;
table->file->reset();
table->file->ha_reset();
}
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
thd->abort_on_warning= 0;