diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-02-11 14:40:35 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-02-11 14:40:35 +0100 |
commit | 646d1ec83a57d9a5b380079afc3612c1d9acadd5 (patch) | |
tree | b46ec54915361f3baa221bcd01b4308a55c59c48 /mysql-test/main/partition_range.test | |
parent | c1eaa385ffb44bdf6264d2cc4b4cc0e10284c88a (diff) | |
parent | 58b70dc13630d2f2f0244359d6351085d70fd5dd (diff) | |
download | mariadb-git-646d1ec83a57d9a5b380079afc3612c1d9acadd5.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'mysql-test/main/partition_range.test')
-rw-r--r-- | mysql-test/main/partition_range.test | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/main/partition_range.test b/mysql-test/main/partition_range.test index 37702db052b..52497764241 100644 --- a/mysql-test/main/partition_range.test +++ b/mysql-test/main/partition_range.test @@ -1001,3 +1001,49 @@ select * from t1 partition (p0); select * from t1 partition (p1); DROP TABLE t1, t2; + +--echo # +--echo # MDEV-21195 INSERT chooses wrong partition for RANGE partitioning by DECIMAL column +--echo # +create or replace table t ( + d decimal(2,1)) partition by range (d) + (partition p1 values less than (10)); + +insert into t values (9.9); + +create or replace table t ( + d decimal(2,1)) partition by range (d) + (partition p1 values less than (10), + partition p2 values less than (20)); + +insert into t values (9.9); +select * from t partition (p1); +select * from t partition (p2); + +create or replace table t ( + d decimal(2,1)) partition by range (d) + (partition p1 values less than (-3)); + +insert into t values (-3.3); + +create or replace table t ( + d decimal(2,1)) partition by range (d+1) + (partition p1 values less than (10), + partition p2 values less than (20)); + +insert into t values (8.9); +select * from t partition (p1); +select * from t partition (p2); + +set time_zone='+00:00'; +create or replace table t ( + d timestamp(1)) partition by range (unix_timestamp(d)) + (partition p1 values less than (1577836800), + partition p2 values less than (2000000000)); + +insert into t values (from_unixtime(1577836799.9)); +select * from t partition (p1); +select * from t partition (p2); + +set time_zone=default; +drop table t; |