1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-26 11:48:52 +03:00
2022-12-09 02:24:40 +00:00

105 lines
2.4 KiB
Plaintext

USE tpch1;
drop table if exists bug3270;
create table bug3270 (c1 decimal(12, 6), c2 float) engine=columnstore;
insert into bug3270
values (5.240620, 5.24062e+06), (7.240620, 7.24062e+06), (9.940620, 9.94062e+06), (5.240620, 5.24062), (5.240720, 5.240720),
(5.240720, 5.240720), (5.240720, 5.240720), (-4.23, -4.23), (-8.89, -8.89);
insert into bug3270 values (-5.240620, -5.24062e+06), (-7.240620, -7.24062e+06), (-9.940620, -9.94062e+06),
(-5.240620, -5.24062), (-5.240720, -5.240720), (-5.240720, -5.240720), (-5.240720, -5.240720);
insert into bug3270 values (-18.9479, -18.9479), (45.1557, 45.1557);
select floor(c1), ceil(c1), c1 from bug3270 order by 1,2,3;
floor(c1) ceil(c1) c1
-19 -18 -18.947900
-10 -9 -9.940620
-9 -8 -8.890000
-8 -7 -7.240620
-6 -5 -5.240720
-6 -5 -5.240720
-6 -5 -5.240720
-6 -5 -5.240620
-6 -5 -5.240620
-5 -4 -4.230000
5 6 5.240620
5 6 5.240620
5 6 5.240720
5 6 5.240720
5 6 5.240720
7 8 7.240620
9 10 9.940620
45 46 45.155700
select floor(c2), ceil(c2), c2 from bug3270 order by 1,2,3;
floor(c2) ceil(c2) c2
-9940620 -9940620 -9940620
-7240620 -7240620 -7240620
-5240620 -5240620 -5240620
-19 -18 -18.9479
-9 -8 -8.89
-6 -5 -5.24072
-6 -5 -5.24072
-6 -5 -5.24072
-6 -5 -5.24062
-5 -4 -4.23
5 6 5.24062
5 6 5.24072
5 6 5.24072
5 6 5.24072
45 46 45.1557
5240620 5240620 5240620
7240620 7240620 7240620
9940620 9940620 9940620
select truncate(c1, 0), truncate(c1, 1), truncate(c1, 2) from bug3270 order by 1,2,3;
truncate(c1, 0) truncate(c1, 1) truncate(c1, 2)
-18 -18.9 -18.94
-9 -9.9 -9.94
-8 -8.8 -8.89
-7 -7.2 -7.24
-5 -5.2 -5.24
-5 -5.2 -5.24
-5 -5.2 -5.24
-5 -5.2 -5.24
-5 -5.2 -5.24
-4 -4.2 -4.23
5 5.2 5.24
5 5.2 5.24
5 5.2 5.24
5 5.2 5.24
5 5.2 5.24
7 7.2 7.24
9 9.9 9.94
45 45.1 45.15
select truncate(c2, 0), truncate(c2, 1), truncate(c2, 2) from bug3270 order by 1,2,3;
truncate(c2, 0) truncate(c2, 1) truncate(c2, 2)
-9940620 -9940620.0 -9940620.00
-7240620 -7240620.0 -7240620.00
-5240620 -5240620.0 -5240620.00
-18 -18.9 -18.94
-8 -8.8 -8.89
-5 -5.2 -5.24
-5 -5.2 -5.24
-5 -5.2 -5.24
-5 -5.2 -5.24
-4 -4.2 -4.23
5 5.2 5.24
5 5.2 5.24
5 5.2 5.24
5 5.2 5.24
45 45.1 45.15
5240620 5240620.0 5240620.00
7240620 7240620.0 7240620.00
9940620 9940620.0 9940620.00
select truncate(c2 ,2), count(*) from bug3270 group by 1 order by 1, 2;
truncate(c2 ,2) count(*)
-9940620.00 1
-7240620.00 1
-5240620.00 1
-18.94 1
-8.89 1
-5.24 4
-4.23 1
5.24 4
45.15 1
5240620.00 1
7240620.00 1
9940620.00 1
drop table if exists bug3270;