From ecc77e275f3e54f0ab9336211665ba4fbbf09dad Mon Sep 17 00:00:00 2001 From: Danila Belous Date: Wed, 18 Dec 2024 16:52:54 +0300 Subject: [PATCH 1/2] fix INT128_MIN write --- src/write.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write.jl b/src/write.jl index b0b14108..314f5e1a 100644 --- a/src/write.jl +++ b/src/write.jl @@ -435,7 +435,7 @@ end function writecell(buf, pos, len, io, x::Integer, opts) if x < 0 - x *= -1 + x = unsigned(-(x + 1)) + 1 @check 1 @inbounds buf[pos] = UInt8('-') pos += 1 From 1c1ce1ede6456be9fed2504413e6485f2ffee7e7 Mon Sep 17 00:00:00 2001 From: Danila Belous Date: Wed, 18 Dec 2024 17:43:10 +0300 Subject: [PATCH 2/2] add write INT128_MIN test --- test/write.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/write.jl b/test/write.jl index a9f683f3..671d8fe0 100644 --- a/test/write.jl +++ b/test/write.jl @@ -195,6 +195,12 @@ Base.string(x::AF) = string(x.f) [StructType(Date("2021-12-01"), "string 1", 123.45), StructType(Date("2021-12-02"), "string 2", 456.78)], (header=["Date Column", "String Column", "Number Column"],), "Date Column,String Column,Number Column\n2021-12-01,string 1,123.45\n2021-12-02,string 2,456.78\n" + ), + # 1151 + ( + [(a=Int128(-170141183460469231731687303715884105728),)], + NamedTuple(), + "a\n-170141183460469231731687303715884105728\n" ) ]