Merge pull request #35755 from Avogar/fix-custom-to-string

Fix bug in conversion from custom types to string
This commit is contained in:
Kruglov Pavel 2022-03-31 00:06:48 +02:00 committed by GitHub
commit 4ec3c35e14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -887,7 +887,7 @@ struct ConvertImplGenericToString
const IColumn & col_from = *col_with_type_and_name.column; const IColumn & col_from = *col_with_type_and_name.column;
size_t size = col_from.size(); size_t size = col_from.size();
auto col_to = result_type->createColumn(); auto col_to = removeNullable(result_type)->createColumn();
{ {
ColumnStringHelpers::WriteHelper write_helper( ColumnStringHelpers::WriteHelper write_helper(

View File

@ -0,0 +1,6 @@
true
\N
0.0.0.0
\N
::ffff:127.0.0.1
\N

View File

@ -0,0 +1,6 @@
select toString(toNullable(true));
select toString(CAST(NULL, 'Nullable(Bool)'));
select toString(toNullable(toIPv4('0.0.0.0')));
select toString(CAST(NULL, 'Nullable(IPv4)'));
select toString(toNullable(toIPv6('::ffff:127.0.0.1')));
select toString(CAST(NULL, 'Nullable(IPv6)'));