minor changes

This commit is contained in:
chertus 2018-08-06 16:48:40 +03:00
parent c590a74981
commit b700d7c7db
3 changed files with 8 additions and 1 deletions

View File

@ -86,7 +86,7 @@ template <typename T>
void DataTypeDecimal<T>::serializeBinary(const Field & field, WriteBuffer & ostr) const
{
/// ColumnType::value_type is a narrower type. For example, UInt8, when the Field type is UInt64
typename ColumnType::value_type x = get<FieldType>(field);
typename ColumnType::value_type x = get<typename NearestFieldType<FieldType>::Type>(field);
writeBinary(x, ostr);
}

View File

@ -21,3 +21,7 @@
0 0 0.00000
0 0 0.00000
42 42 42.42000
1 0
1 0
1 0
1 0

View File

@ -44,4 +44,7 @@ SELECT least(a, b), least(a, g), greatest(a, b), greatest(a, g) FROM test.decima
SELECT least(a, 0), least(b, 0), least(g, 0) FROM test.decimal ORDER BY a;
SELECT greatest(a, 0), greatest(b, 0), greatest(g, 0) FROM test.decimal ORDER BY a;
SELECT (a, d, g) = (b, e, h), (a, d, g) != (b, e, h) FROM test.decimal ORDER BY a;
SELECT (a, d, g) = (c, f, i), (a, d, g) != (c, f, i) FROM test.decimal ORDER BY a;
DROP TABLE IF EXISTS test.decimal;