summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2005-04-22 17:13:18 +0200
committerunknown <ingo@mysql.com>2005-04-22 17:13:18 +0200
commitac6d9b2e50424eb9c936c26332f2417bc108315c (patch)
treeb08be759083bb7e6ee615ba268d4fea7b0b664e0 /sql/sql_insert.cc
parentc795511cf43088776b18647beb2464c42799d0c8 (diff)
parent3431b2179f45c040e90a54a57f90c56f674f843c (diff)
downloadmariadb-git-ac6d9b2e50424eb9c936c26332f2417bc108315c.tar.gz
Bug#7806 - insert on duplicate key and auto-update of timestamp
Merged fix for bugfix to 5.0. sql/table.h: Auto merged
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index a38138ca5fd..9a7a3d64de5 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -103,7 +103,8 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
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
@@ -150,7 +151,8 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
}
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
@@ -216,7 +218,8 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
{
/* 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;
}