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
fix(funexp): MCOL-4622 Implicit FLOAT->INT and DOUBLE->INT conversion is not like in InnoDB (#3480)
This commit is contained in:
@ -771,10 +771,10 @@ inline uint64_t TreeNode::getUintVal()
|
|||||||
case CalpontSystemCatalog::UINT: return fResult.uintVal;
|
case CalpontSystemCatalog::UINT: return fResult.uintVal;
|
||||||
|
|
||||||
case CalpontSystemCatalog::FLOAT:
|
case CalpontSystemCatalog::FLOAT:
|
||||||
case CalpontSystemCatalog::UFLOAT: return (uint64_t)fResult.floatVal;
|
case CalpontSystemCatalog::UFLOAT: return (uint64_t)std::llround(fResult.floatVal);
|
||||||
|
|
||||||
case CalpontSystemCatalog::DOUBLE:
|
case CalpontSystemCatalog::DOUBLE:
|
||||||
case CalpontSystemCatalog::UDOUBLE: return (uint64_t)fResult.doubleVal;
|
case CalpontSystemCatalog::UDOUBLE: return (uint64_t)std::llround(fResult.doubleVal);
|
||||||
|
|
||||||
case CalpontSystemCatalog::LONGDOUBLE: return (uint64_t)fResult.longDoubleVal;
|
case CalpontSystemCatalog::LONGDOUBLE: return (uint64_t)fResult.longDoubleVal;
|
||||||
|
|
||||||
|
17
mysql-test/columnstore/bugfixes/mcol_4622.result
Normal file
17
mysql-test/columnstore/bugfixes/mcol_4622.result
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
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;
|
||||||
|
DROP DATABASE mcol_4622;
|
28
mysql-test/columnstore/bugfixes/mcol_4622.test
Normal file
28
mysql-test/columnstore/bugfixes/mcol_4622.test
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
-- source ../include/have_columnstore.inc
|
||||||
|
--disable_warnings
|
||||||
|
DROP DATABASE IF EXISTS mcol_4622;
|
||||||
|
--enable_warnings
|
||||||
|
CREATE DATABASE mcol_4622;
|
||||||
|
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;
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP DATABASE mcol_4622;
|
||||||
|
--enable_warnings
|
Reference in New Issue
Block a user