You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
This patch calculates precision and scale for constant decimal value for SUM aggregation function.
18 lines
832 B
Plaintext
18 lines
832 B
Plaintext
DROP DATABASE IF EXISTS mcol_5708;
|
|
CREATE DATABASE mcol_5708;
|
|
USE mcol_5708;
|
|
CREATE TABLE test (
|
|
`f_int` int(10) unsigned NOT NULL DEFAULT 0,
|
|
`f_dec14x2` decimal(14,2) NOT NULL DEFAULT 0.00,
|
|
`f_dec14x4` decimal(14,4) NOT NULL DEFAULT 0.0000
|
|
) ENGINE=columnstore DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
|
insert into test (f_int,f_dec14x4, f_dec14x2) values (1, 0.1, 0.1);
|
|
select
|
|
f_int, sum(f_dec14x2), sum(f_dec14x4),
|
|
sum(-200.000001), sum(0), sum(0.0), sum(11.000011), sum(12e-4), sum(1e+4),
|
|
sum(-0.0), sum(-1 - 1.1), sum(--12), sum(+20), sum(13)
|
|
from test group by 1;
|
|
f_int sum(f_dec14x2) sum(f_dec14x4) sum(-200.000001) sum(0) sum(0.0) sum(11.000011) sum(12e-4) sum(1e+4) sum(-0.0) sum(-1 - 1.1) sum(--12) sum(+20) sum(13)
|
|
1 0.10 0.1000 -200.000001 0 0.0 11.000011 0.0012 10000 0.0 -2.1 12 20 13
|
|
DROP DATABASE mcol_5708;
|