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

Bug#7806 - insert on duplicate key and auto-update of timestamp

A fix of the original patch.
Correctly clear a bit from an enum value.
This commit is contained in:
unknown
2005-04-22 12:30:09 +02:00
parent cfac923cf5
commit 3431b2179f
2 changed files with 16 additions and 9 deletions

View File

@ -80,7 +80,8 @@ static int check_insert_fields(THD *thd, TABLE *table, List<Item> &fields,
check_grant_all_columns(thd,INSERT_ACL,table))
return -1;
#endif
*(int*)&table->timestamp_field_type&= ~ (int) TIMESTAMP_AUTO_SET_ON_INSERT;
clear_timestamp_auto_bits(table->timestamp_field_type,
TIMESTAMP_AUTO_SET_ON_INSERT);
}
else
{ // Part field list
@ -110,7 +111,8 @@ static int check_insert_fields(THD *thd, TABLE *table, List<Item> &fields,
}
if (table->timestamp_field && // Don't set timestamp if used
table->timestamp_field->query_id == thd->query_id)
*(int*)&table->timestamp_field_type&= ~ (int) TIMESTAMP_AUTO_SET_ON_INSERT;
clear_timestamp_auto_bits(table->timestamp_field_type,
TIMESTAMP_AUTO_SET_ON_INSERT);
}
// For the values we need select_priv
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@ -167,7 +169,8 @@ static int check_update_fields(THD *thd, TABLE *table,
{
/* Don't set timestamp column if this is modified. */
if (table->timestamp_field->query_id == thd->query_id)
*(int*)&table->timestamp_field_type&= ~ (int) TIMESTAMP_AUTO_SET_ON_UPDATE;
clear_timestamp_auto_bits(table->timestamp_field_type,
TIMESTAMP_AUTO_SET_ON_UPDATE);
else
table->timestamp_field->query_id= timestamp_query_id;
}