Closed erimatnor closed 1 week ago
Don't we have a test for deletion DML? That would have been triggered on the 386 tests..
The issue is with the comparison
device = 1
our code converts the 1
into an int4 constant whereas the device is int8. So when we generate the batch filter the scankey does a comparison between int8 and int4 causing the crash on i386 machines.
If we change the query to:
delete from hyper where device = 1::int8;
then the query does not crash as expected.
Turns out that when we initialize the scan key for the batch decompression, we need to check if the attribute type and the constant argument types are the same. If not, the scan key subtype
needs to be set appropriately.
What type of bug is this?
Crash
What subsystems and features are affected?
Compression
What happened?
A crash occurs when deleting or updating compressed data using a predicate on a column that a by reference type. This is the case for, e.g., 8 byte integers when running on a 32-bit system.
The issue seems to be due to DML decompression using a scankey that doesn't properly handle the by reference value, leading to memory corruption.
TimescaleDB version affected
2.16.0-dev
PostgreSQL version used
16.3
What operating system did you use?
Debian
What installation method did you use?
Source
What platform did you run on?
Other
Relevant log output and stack trace
How can we reproduce the bug?