Skip to content

Commit

Permalink
Use the proper error code for corrupt compressed array (#6943)
Browse files Browse the repository at this point in the history
Currently we use elog() which has a wrong error code XX000.

(cherry picked from commit 1d7bd07)
  • Loading branch information
akuzm authored and timescale-automation committed May 22, 2024
1 parent b997cb5 commit 09a8877
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tsl/src/compression/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tsl/test/expected/compression_algos.out
Original file line number Diff line number Diff line change
Expand Up @@ -1596,8 +1596,8 @@ group by 2, 3 order by 1 desc
count | bulk_result | rowbyrow_result
-------+-------------+-----------------
18 | true | true
14 | XX001 | XX001
7 | 08P01 | 08P01
15 | XX001 | XX001
8 | 08P01 | 08P01
2 | 3F000 | 3F000
1 | 22021 | 22021
1 | false | false
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 09a8877

Please sign in to comment.