From c75ba6db6021906d01fd9067b5385e083ca57bdb Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Wed, 22 May 2024 09:26:13 +0200 Subject: [PATCH 1/3] Use the proper error code for corrupt compressed array Currently we use elog() which has a wrong error code XX000. --- tsl/src/compression/array.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tsl/src/compression/array.c b/tsl/src/compression/array.c index 3c658382abd..a10c4d6dc9f 100644 --- a/tsl/src/compression/array.c +++ b/tsl/src/compression/array.c @@ -368,8 +368,7 @@ tsl_array_decompression_iterator_from_datum_forward(Datum compressed_array, Oid Assert(compressed_array_header->compression_algorithm == COMPRESSION_ALGORITHM_ARRAY); - if (element_type != compressed_array_header->element_type) - elog(ERROR, "trying to decompress the wrong type"); + CheckCompressedData(element_type == compressed_array_header->element_type); return array_decompression_iterator_alloc_forward(&si, compressed_array_header->element_type, From d6e5529ca6b7688bc3805da993b3e2a42ea333cf Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Wed, 22 May 2024 09:29:53 +0200 Subject: [PATCH 2/3] Add a test --- tsl/test/expected/compression_algos.out | 6 +++--- .../00174d96774997a7da3432303f185aae1be1f3e6 | Bin 0 -> 25 bytes .../09eb2c1146a0b123344cf58991431786b99260bb | Bin 0 -> 24 bytes .../ede4129ca9c4d8dbd649aa6f2d5c0038e1537716 | Bin 0 -> 32 bytes .../ef519c31ea5d415293021b0ca83dd655701d2c13 | Bin 0 -> 32843 bytes .../f427c54444d4a2f7381deab79a1ac025dac8b485 | Bin 0 -> 29 bytes 6 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 tsl/test/fuzzing/compression/array-text/00174d96774997a7da3432303f185aae1be1f3e6 create mode 100644 tsl/test/fuzzing/compression/array-text/09eb2c1146a0b123344cf58991431786b99260bb create mode 100644 tsl/test/fuzzing/compression/array-text/ede4129ca9c4d8dbd649aa6f2d5c0038e1537716 create mode 100644 tsl/test/fuzzing/compression/array-text/ef519c31ea5d415293021b0ca83dd655701d2c13 create mode 100644 tsl/test/fuzzing/compression/array-text/f427c54444d4a2f7381deab79a1ac025dac8b485 diff --git a/tsl/test/expected/compression_algos.out b/tsl/test/expected/compression_algos.out index bf50a924680..37ecb82e0a8 100644 --- a/tsl/test/expected/compression_algos.out +++ b/tsl/test/expected/compression_algos.out @@ -1596,10 +1596,10 @@ group by 2, 3 order by 1 desc count | bulk_result | rowbyrow_result -------+-------------+----------------- 18 | true | true - 14 | XX001 | XX001 - 7 | 08P01 | 08P01 + 17 | XX001 | XX001 + 8 | 08P01 | 08P01 + 2 | 22021 | 22021 2 | 3F000 | 3F000 - 1 | 22021 | 22021 1 | false | false (6 rows) diff --git a/tsl/test/fuzzing/compression/array-text/00174d96774997a7da3432303f185aae1be1f3e6 b/tsl/test/fuzzing/compression/array-text/00174d96774997a7da3432303f185aae1be1f3e6 new file mode 100644 index 0000000000000000000000000000000000000000..3f5de478253c762671c63a2638765bbec9d6a3ac GIT binary patch literal 25 ccmZQ%EJ%+}PAo~x$xmmf$V{_=J5)sK2f)**Ryq_-GNKivg_QTCSixf%R$-I$avkA_c zbGzN|y4~^AHr?U3Yp$Qa+t!A_kidNCpko9GTm@E34vzww$D@fo1PBlyP_uyfLe15e zI{^a01T@oNlm;U3@d96QuFz^l99N?fATVJ8jdQ}qm0BnPw<)0{jgv}Xohpzx1PT=B zPklB8X5f+u5FkK+KmY+ZIROw2L4W`O&D3vzKs^E;Y}Zq3nGzsCfIwaWbL_nSq7z6d zV2+(qTPy+u2)q{Pzd`Z(JVyu+AW)xx4q0E#W&Cde3pvloG>>O0_7NaZnt%>pTE$#1 zf%gS0)xU4&n*<0D7$cz1j!|+B0RjZ#3s|#@Z!ALb0+xe{FJW~FtgFjd!UV<(^rt@l zPiMTGGYJqNKwwe=ZgM77PRS4;kV`-_%_T1`f%F2A9&D#iL_`9a1iqV}#Xa-|bqER@ literal 0 HcmV?d00001 diff --git a/tsl/test/fuzzing/compression/array-text/f427c54444d4a2f7381deab79a1ac025dac8b485 b/tsl/test/fuzzing/compression/array-text/f427c54444d4a2f7381deab79a1ac025dac8b485 new file mode 100644 index 0000000000000000000000000000000000000000..f11471307131b43f28dd9babf6a079b7a3ff6d4d GIT binary patch literal 29 fcmZQ%EJ%+}PAo~x$xmmf$V{ Date: Wed, 22 May 2024 11:17:13 +0200 Subject: [PATCH 3/3] remove the flaky tests --- tsl/test/expected/compression_algos.out | 4 ++-- .../00174d96774997a7da3432303f185aae1be1f3e6 | Bin 25 -> 0 bytes .../09eb2c1146a0b123344cf58991431786b99260bb | Bin 24 -> 0 bytes .../f427c54444d4a2f7381deab79a1ac025dac8b485 | Bin 29 -> 0 bytes 4 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 tsl/test/fuzzing/compression/array-text/00174d96774997a7da3432303f185aae1be1f3e6 delete mode 100644 tsl/test/fuzzing/compression/array-text/09eb2c1146a0b123344cf58991431786b99260bb delete mode 100644 tsl/test/fuzzing/compression/array-text/f427c54444d4a2f7381deab79a1ac025dac8b485 diff --git a/tsl/test/expected/compression_algos.out b/tsl/test/expected/compression_algos.out index 37ecb82e0a8..60eafcab4ed 100644 --- a/tsl/test/expected/compression_algos.out +++ b/tsl/test/expected/compression_algos.out @@ -1596,10 +1596,10 @@ group by 2, 3 order by 1 desc count | bulk_result | rowbyrow_result -------+-------------+----------------- 18 | true | true - 17 | XX001 | XX001 + 15 | XX001 | XX001 8 | 08P01 | 08P01 - 2 | 22021 | 22021 2 | 3F000 | 3F000 + 1 | 22021 | 22021 1 | false | false (6 rows) diff --git a/tsl/test/fuzzing/compression/array-text/00174d96774997a7da3432303f185aae1be1f3e6 b/tsl/test/fuzzing/compression/array-text/00174d96774997a7da3432303f185aae1be1f3e6 deleted file mode 100644 index 3f5de478253c762671c63a2638765bbec9d6a3ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25 ccmZQ%EJ%+}PAo~x$xmmf$V{