summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorJacob Mathew <jacob.mathew@mariadb.com>2018-07-09 16:09:20 -0700
committerJacob Mathew <jacob.mathew@mariadb.com>2018-07-09 16:09:20 -0700
commit813b7398500f8d216c11da9b92135048a03f3227 (patch)
treebaf2ea69ef7b22db8c80bdff18b79eb6bdbf9652 /sql/ha_partition.cc
parentbbf780efcd26f468ec83ede5ecc18ca6f96802fb (diff)
downloadmariadb-git-813b7398500f8d216c11da9b92135048a03f3227.tar.gz
MDEV-16246: insert timestamp into spider table from mysqldump gets wrong time zone.
The problem occurred because the Spider node was incorrectly handling timestamp values sent to and received from the data nodes. The problem has been corrected as follows: - Added logic to set and maintain the UTC time zone on the data nodes. To prevent timestamp ambiguity, it is necessary for the data nodes to use a time zone such as UTC which does not have daylight savings time. - Removed the spider_sync_time_zone configuration variable, which did not solve the problem and which interfered with the solution. - Added logic to convert to the UTC time zone all timestamp values sent to and received from the data nodes. This is done for both unique and non-unique timestamp columns. It is done for WHERE clauses, applying to SELECT, UPDATE and DELETE statements, and for UPDATE columns. - Disabled Spider's use of direct update when any of the columns to update is a timestamp column. This is necessary to prevent false duplicate key value errors. - Added a new test spider.timestamp to thoroughly test Spider's handling of timestamp values. Author: Jacob Mathew. Reviewer: Kentoku Shiba. Cherry-Picked: Commit 97cc9d3 on branch bb-10.3-MDEV-16246
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index befcc62080e..7e04cabc765 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -11143,13 +11143,14 @@ int ha_partition::end_bulk_delete()
SYNOPSIS
direct_update_rows_init()
+ update fields Pointer to the list of fields to update
RETURN VALUE
>0 Error
0 Success
*/
-int ha_partition::direct_update_rows_init()
+int ha_partition::direct_update_rows_init(List<Item> *update_fields)
{
int error;
uint i, found;
@@ -11175,8 +11176,8 @@ int ha_partition::direct_update_rows_init()
{
file= m_file[i];
if (unlikely((error= (m_pre_calling ?
- file->pre_direct_update_rows_init() :
- file->direct_update_rows_init()))))
+ file->pre_direct_update_rows_init(update_fields) :
+ file->direct_update_rows_init(update_fields)))))
{
DBUG_PRINT("info", ("partition FALSE by storage engine"));
DBUG_RETURN(error);
@@ -11214,20 +11215,21 @@ int ha_partition::direct_update_rows_init()
SYNOPSIS
pre_direct_update_rows_init()
+ update fields Pointer to the list of fields to update
RETURN VALUE
>0 Error
0 Success
*/
-int ha_partition::pre_direct_update_rows_init()
+int ha_partition::pre_direct_update_rows_init(List<Item> *update_fields)
{
bool save_m_pre_calling;
int error;
DBUG_ENTER("ha_partition::pre_direct_update_rows_init");
save_m_pre_calling= m_pre_calling;
m_pre_calling= TRUE;
- error= direct_update_rows_init();
+ error= direct_update_rows_init(update_fields);
m_pre_calling= save_m_pre_calling;
DBUG_RETURN(error);
}