You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-4671: MCOL-4622: fix the behavior of both PRs
first was playing different with RIGHT and LEFT functions(using the getUintVal and getIntVal accordingly) https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/3234 second introduced round for ints from double, but added it to uint but not to int missing long doubles as well https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/3480
This commit is contained in:
committed by
Leonid Fedorov
parent
842ec9dbff
commit
5814a80b50
@ -2,16 +2,47 @@ DROP DATABASE IF EXISTS mcol_4622;
|
||||
CREATE DATABASE mcol_4622;
|
||||
USE mcol_4622;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a VARCHAR(32), d FLOAT) ENGINE=ColumnStore;
|
||||
INSERT INTO t1 VALUES ('aaaa', 1.5);
|
||||
SELECT LEFT(a, d) FROM t1;
|
||||
LEFT(a, d)
|
||||
aa
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a VARCHAR(32), d DOUBLE) ENGINE=ColumnStore;
|
||||
INSERT INTO t1 VALUES ('aaaa', 1.5);
|
||||
SELECT LEFT(a, d) FROM t1;
|
||||
LEFT(a, d)
|
||||
aa
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a VARCHAR(32), b FLOAT, c DOUBLE) ENGINE=ColumnStore;
|
||||
INSERT INTO t1 VALUES ('aaaa', 1.5, 1.5);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', 1.2, 1.2);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', 1.5, 1.5);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', 1.7, 1.7);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', 12, 12);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', -0, 0);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', -2, -2);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', -12, -12);
|
||||
SELECT LEFT(a, b), LEFT(a, c), RIGHT(a, b), RIGHT(a, c) FROM t1;
|
||||
LEFT(a, b) LEFT(a, c) RIGHT(a, b) RIGHT(a, c)
|
||||
aa aa aa aa
|
||||
a a h h
|
||||
ab ab gh gh
|
||||
ab ab gh gh
|
||||
abcdefgh abcdefgh abcdefgh abcdefgh
|
||||
|
||||
|
||||
|
||||
create table TFloatsInnoDB(a float, b double) engine innodb;
|
||||
insert into TFloatsInnoDB values (-3.5,-3.5),(-3.1, -3.1),(-3.0, -3.0),(-2.9,-2.9),(0,0),(2.9, 2.9),(3.1,3.1),(3.5,3.5);
|
||||
select a, cast(a as signed), cast(a as unsigned), b, cast(b as signed), cast(b as unsigned) from TFloatsInnoDB;
|
||||
a cast(a as signed) cast(a as unsigned) b cast(b as signed) cast(b as unsigned)
|
||||
-3.5 -4 0 -3.5 -4 0
|
||||
-3.1 -3 0 -3.1 -3 0
|
||||
-3 -3 0 -3 -3 0
|
||||
-2.9 -3 0 -2.9 -3 0
|
||||
0 0 0 0 0 0
|
||||
2.9 3 3 2.9 3 3
|
||||
3.1 3 3 3.1 3 3
|
||||
3.5 4 4 3.5 4 4
|
||||
create table TFloatsCS(a float, b double) engine columnstore;
|
||||
insert into TFloatsCS values (-3.5,-3.5),(-3.1, -3.1),(-3.0, -3.0),(-2.9,-2.9),(0,0),(2.9, 2.9),(3.1,3.1),(3.5,3.5);
|
||||
select a, cast(a as signed), cast(a as unsigned), b, cast(b as signed), cast(b as unsigned) from TFloatsCS;
|
||||
a cast(a as signed) cast(a as unsigned) b cast(b as signed) cast(b as unsigned)
|
||||
-3.5 -4 0 -3.5 -4 0
|
||||
-3.1 -3 0 -3.1 -3 0
|
||||
-3 -3 0 -3 -3 0
|
||||
-2.9 -3 0 -2.9 -3 0
|
||||
0 0 0 0 0 0
|
||||
2.9 3 3 2.9 3 3
|
||||
3.1 3 3 3.1 3 3
|
||||
3.5 4 4 3.5 4 4
|
||||
DROP DATABASE mcol_4622;
|
||||
|
@ -7,22 +7,26 @@ USE mcol_4622;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (a VARCHAR(32), d FLOAT) ENGINE=ColumnStore;
|
||||
INSERT INTO t1 VALUES ('aaaa', 1.5);
|
||||
SELECT LEFT(a, d) FROM t1;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (a VARCHAR(32), d DOUBLE) ENGINE=ColumnStore;
|
||||
INSERT INTO t1 VALUES ('aaaa', 1.5);
|
||||
SELECT LEFT(a, d) FROM t1;
|
||||
CREATE TABLE t1 (a VARCHAR(32), b FLOAT, c DOUBLE) ENGINE=ColumnStore;
|
||||
INSERT INTO t1 VALUES ('aaaa', 1.5, 1.5);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', 1.2, 1.2);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', 1.5, 1.5);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', 1.7, 1.7);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', 12, 12);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', -0, 0);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', -2, -2);
|
||||
INSERT INTO t1 VALUES ('abcdefgh', -12, -12);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
SELECT LEFT(a, b), LEFT(a, c), RIGHT(a, b), RIGHT(a, c) FROM t1;
|
||||
|
||||
create table TFloatsInnoDB(a float, b double) engine innodb;
|
||||
insert into TFloatsInnoDB values (-3.5,-3.5),(-3.1, -3.1),(-3.0, -3.0),(-2.9,-2.9),(0,0),(2.9, 2.9),(3.1,3.1),(3.5,3.5);
|
||||
select a, cast(a as signed), cast(a as unsigned), b, cast(b as signed), cast(b as unsigned) from TFloatsInnoDB;
|
||||
|
||||
create table TFloatsCS(a float, b double) engine columnstore;
|
||||
insert into TFloatsCS values (-3.5,-3.5),(-3.1, -3.1),(-3.0, -3.0),(-2.9,-2.9),(0,0),(2.9, 2.9),(3.1,3.1),(3.5,3.5);
|
||||
select a, cast(a as signed), cast(a as unsigned), b, cast(b as signed), cast(b as unsigned) from TFloatsCS;
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE mcol_4622;
|
||||
--enable_warnings
|
||||
|
Reference in New Issue
Block a user