From 4124f7d251a8d01d019a7a8b56c6ac9a2e96482c Mon Sep 17 00:00:00 2001 From: Dmitriy Chugunov Date: Fri, 16 Mar 2018 16:12:23 +0300 Subject: [PATCH] Decode numeric zeros with correct scale --- asyncpg/protocol/codecs/numeric.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncpg/protocol/codecs/numeric.pyx b/asyncpg/protocol/codecs/numeric.pyx index 71a97917..5e0e2cfd 100644 --- a/asyncpg/protocol/codecs/numeric.pyx +++ b/asyncpg/protocol/codecs/numeric.pyx @@ -161,7 +161,7 @@ cdef numeric_decode_binary(ConnectionSettings settings, FastReadBuffer buf): if num_pgdigits == 0: # Zero - return _Dec() + return _Dec('0e-' + str(dscale)) pgdigit0 = hton.unpack_int16(buf.read(2)) if weight >= 0: