diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2019-08-28 11:57:16 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2019-09-01 14:04:25 +0300 |
commit | c3f35ea55a7150b186284e2ef717d12e6f81e13e (patch) | |
tree | 3ad2bd5855280e9b58f95d5e58cc50318ea19cfd /mysql-test/main/partition_range.result | |
parent | a3e49c0d36c0347e9dee43f9996ca7c407836a51 (diff) | |
download | mariadb-git-c3f35ea55a7150b186284e2ef717d12e6f81e13e.tar.gz |
MDEV-18501 Partition pruning doesn't work for historical queries (refactoring)
SYSTEM_TYPE partitioning: COLUMN properties removed. Partitioning is
now pure RANGE based on UNIX_TIMESTAMP(row_end).
DECIMAL type is now allowed as RANGE partitioning, we can partition by
UNIX_TIMESTAMP() (but not for DATETIME which depends on local timezone
of course).
Diffstat (limited to 'mysql-test/main/partition_range.result')
-rw-r--r-- | mysql-test/main/partition_range.result | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/main/partition_range.result b/mysql-test/main/partition_range.result index 7ae029d488c..00171e3e0bd 100644 --- a/mysql-test/main/partition_range.result +++ b/mysql-test/main/partition_range.result @@ -981,4 +981,31 @@ a MAX(b) SHOW status LIKE 'handler_read_key'; Variable_name Value Handler_read_key 4 +# +# MDEV-18501 Partition pruning doesn't work for historical queries +# +set time_zone= '+00:00'; +create or replace table t1 (d datetime(6)) +partition by range (unix_timestamp(d)) ( +partition p0 values less than (1), +partition p1 values less than (maxvalue)); +ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed +# DECIMAL functions are now allowed, partitioning is done by integer part +create or replace table t1 (d timestamp(6)) +partition by range (unix_timestamp(d)) ( +partition p0 values less than (946684801), +partition p1 values less than (maxvalue)); +insert into t1 values +# go to p0 +('2000-01-01 00:00:00'), +('2000-01-01 00:00:00.000001'), +# goes to p1 +('2000-01-01 00:00:01'); +select * from t1 partition (p0); +d +2000-01-01 00:00:00.000000 +2000-01-01 00:00:00.000001 +select * from t1 partition (p1); +d +2000-01-01 00:00:01.000000 DROP TABLE t1, t2; |