mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
dbms: Server: Adding nullable type support to functions manipulating arrays. [#METR-19266]
This commit is contained in:
parent
bad88a8062
commit
bd53eb8054
@ -2538,27 +2538,6 @@ bool FunctionArrayReverse::executeFixedString(
|
||||
{
|
||||
if (const ColumnFixedString * src_data_concrete = typeid_cast<const ColumnFixedString *>(&src_data))
|
||||
{
|
||||
/// XXX The original implementation, i.e. everything but the new code
|
||||
/// XXX for nullable support is buggy. Example with a table with one column
|
||||
/// XXX whose type is Array(FixedString(3))):
|
||||
/// │ ['a\0\0','bc\0','def'] │
|
||||
/// │ ['a\0\0','bc\0','def'] │
|
||||
/// │ ['a\0\0','bc\0','def'] │
|
||||
/// │ ['a\0\0','bc\0','def'] │
|
||||
/// │ ['a\0\0','bc\0','def'] │
|
||||
/// │ ['a\0\0','bc\0','def'] │
|
||||
/// │ ['a\0\0','bc\0','def'] │
|
||||
///
|
||||
/// XXX SELECT reverse(col) FROM table gives the following output:
|
||||
///
|
||||
/// │ ['def','a\0\0','bc\0'] │
|
||||
/// │ ['def','a\0\0','bc\0'] │
|
||||
/// │ ['def','a\0\0','bc\0'] │
|
||||
/// │ ['def','a\0\0','bc\0'] │
|
||||
/// │ ['def','a\0\0','bc\0'] │
|
||||
/// │ ['def','a\0\0','bc\0'] │
|
||||
/// │ ['def','\0\0\0','\0\0\0'] │
|
||||
|
||||
const size_t n = src_data_concrete->getN();
|
||||
const ColumnFixedString::Chars_t & src_data = src_data_concrete->getChars();
|
||||
ColumnFixedString::Chars_t & res_data = typeid_cast<ColumnFixedString &>(res_data_col).getChars();
|
||||
@ -2579,7 +2558,8 @@ bool FunctionArrayReverse::executeFixedString(
|
||||
|
||||
while (src < src_end)
|
||||
{
|
||||
memcpySmallAllowReadWriteOverflow15(dst, src, n);
|
||||
/// NOTE: memcpySmallAllowReadWriteOverflow15 doesn't work correctly here.
|
||||
memcpy(dst, src, n);
|
||||
src += n;
|
||||
dst -= n;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user