diff --git a/dbms/include/DB/IO/WriteIntText.h b/dbms/include/DB/IO/WriteIntText.h index 50b71a35970..08ff03f35f0 100644 --- a/dbms/include/DB/IO/WriteIntText.h +++ b/dbms/include/DB/IO/WriteIntText.h @@ -29,6 +29,15 @@ namespace detail template void writeUIntTextFallback(T x, WriteBuffer & buf) { + if (x == 0) + { + buf.nextIfAtEnd(); + *buf.position() = '0'; + ++buf.position(); + + return; + } + char tmp[WRITE_HELPERS_MAX_INT_WIDTH]; char * pos;