1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-4940: test case for ROUND fix (#2270)

This commit is contained in:
benthompson15
2022-02-21 16:09:25 -06:00
committed by GitHub
parent b1d6201ee3
commit 41d2b3e9e0
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,11 @@
DROP DATABASE IF EXISTS mcol_4940;
CREATE DATABASE mcol_4940;
USE mcol_4940;
create table rounding_table ( a int, b double, c double) engine=columnstore;
insert into rounding_table values (26805, 1252, -9647);
insert into rounding_table values (26806, 573, -2804.5);
SELECT CASE a WHEN 26805 THEN ROUND(c/b, 2) WHEN 26806 THEN b END MCOL4940 FROM ( SELECT a, SUM(b) b, SUM(c) c FROM rounding_table GROUP BY a ) abc ;
MCOL4940
573
-7.71
DROP DATABASE mcol_4940;

View File

@ -0,0 +1,14 @@
--source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS mcol_4940;
--enable_warnings
CREATE DATABASE mcol_4940;
USE mcol_4940;
create table rounding_table ( a int, b double, c double) engine=columnstore;
insert into rounding_table values (26805, 1252, -9647);
insert into rounding_table values (26806, 573, -2804.5);
SELECT CASE a WHEN 26805 THEN ROUND(c/b, 2) WHEN 26806 THEN b END MCOL4940 FROM ( SELECT a, SUM(b) b, SUM(c) c FROM rounding_table GROUP BY a ) abc ;
DROP DATABASE mcol_4940;