hotfix for Decimal.compareAt

This commit is contained in:
chertus 2019-08-07 16:53:46 +03:00
parent 048fe08bde
commit 5bb0cde59c
3 changed files with 17 additions and 1 deletions

View File

@ -26,7 +26,7 @@ namespace ErrorCodes
template <typename T>
int ColumnDecimal<T>::compareAt(size_t n, size_t m, const IColumn & rhs_, int) const
{
auto other = static_cast<const Self &>(rhs_);
auto & other = static_cast<const Self &>(rhs_);
const T & a = data[n];
const T & b = other.data[m];

View File

@ -0,0 +1,2 @@
1000000
1000000

View File

@ -0,0 +1,14 @@
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (str String, dec Decimal64(8)) ENGINE = MergeTree ORDER BY str;
CREATE TABLE t2 (str String, dec Decimal64(8)) ENGINE = MergeTree ORDER BY dec;
INSERT INTO t1 SELECT toString(number), toDecimal64(number, 8) FROM system.numbers LIMIT 1000000;
SELECT count() FROM t1;
INSERT INTO t2 SELECT toString(number), toDecimal64(number, 8) FROM system.numbers LIMIT 1000000;
SELECT count() FROM t2;
DROP TABLE t1;
DROP TABLE t2;