summaryrefslogtreecommitdiff
path: root/sql/sql_partition.h
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2009-12-13 23:29:50 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2009-12-13 23:29:50 +0300
commita8cfe3d4f74db680084c3ec8a8b6fbd8f71780d6 (patch)
tree9618da2b288832f2f203077e1254b626a4bd6475 /sql/sql_partition.h
parent13f7a81b3781c7e5496874641d35e5b20ff81635 (diff)
downloadmariadb-git-a8cfe3d4f74db680084c3ec8a8b6fbd8f71780d6.tar.gz
Bug #42849: innodb crash with varying time_zone on partitioned
timestamp primary key Since TIMESTAMP values are adjusted by the current time zone settings in both numeric and string contexts, using any expressions involving TIMESTAMP values as a (sub)partitioning function leads to undeterministic behavior of partitioned tables. The effect may vary depending on a storage engine, it can be either incorrect data being retrieved or stored, or an assertion failure. The root cause of this is the fact that the calculated partition ID may differ from a previously calculated ID for the same data due to timezone adjustments of the partitioning expression value. Fixed by disabling any expressions involving TIMESTAMP values to be used in partitioning functions with the follwing two exceptions: 1. Creating or altering into a partitioned table that violates the above rule is not allowed, but opening existing such tables results in a warning rather than an error so that such tables could be fixed. 2. UNIX_TIMESTAMP() is the only way to get a timezone-independent value from a TIMESTAMP column, because it returns the internal representation (a time_t value) of a TIMESTAMP argument verbatim. So UNIX_TIMESTAMP(timestamp_column) is allowed and should be used to fix existing tables if one wants to use TIMESTAMP columns with partitioning.
Diffstat (limited to 'sql/sql_partition.h')
-rw-r--r--sql/sql_partition.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index 282e24f1853..b9efbf25a00 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -91,9 +91,6 @@ uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
bool left_endpoint,
bool include_endpoint);
-bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
- bool is_sub_part, bool is_field_to_be_setup);
-
bool check_part_func_fields(Field **ptr, bool ok_with_charsets);
bool field_is_partition_charset(Field *field);