- Notifications
You must be signed in to change notification settings - Fork5.3k
Commite4316ec
committed
Fix incorrect zero extension of Datum in JIT tuple deform code
When JIT deformed tuples (controlled via the jit_tuple_deforming GUC),types narrower than sizeof(Datum) would be zero-extended up to Datumwidth. This wasn't the same as what fetch_att() does in the standardtuple deforming code. Logically the values are the same when fetchingvia the DatumGet*() marcos, but negative numbers are not the same inbinary form.In the report, the problem was manifesting itself with:ERROR: could not find memoization table entryin a query which had a "Cache Mode: binary" Memoize node. However, it'scurrently unclear what else is affected. Anything that usesdatum_image_eq() or datum_image_hash() on a Datum from a tuple deformed byJIT could be affected, but it may not be limited to that.The fix for this is simple: use signed extension instead of zeroextension.Many thanks to Emmanuel Touzery for reporting this issue and providingsteps and backup which allowed the problem to easily be recreated.Reported-by: Emmanuel Touzery <emmanuel.touzery@plandela.si>Author: David Rowley <dgrowleyml@gmail.com>Discussion:https://postgr.es/m/DB8P194MB08532256D5BAF894F241C06393F3A@DB8P194MB0853.EURP194.PROD.OUTLOOK.COMBackpatch-through: 131 parentf106f53 commite4316ec
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
| 682 | + | |
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| |||
0 commit comments
Comments
(0)