Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite4316ec

Browse files
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: 13
1 parentf106f53 commite4316ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/jit/llvm/llvmjit_deform.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc,
679679
v_tmp_loaddata=
680680
LLVMBuildPointerCast(b,v_attdatap,vartypep,"");
681681
v_tmp_loaddata=l_load(b,vartype,v_tmp_loaddata,"attr_byval");
682-
v_tmp_loaddata=LLVMBuildZExt(b,v_tmp_loaddata,TypeSizeT,"");
682+
v_tmp_loaddata=LLVMBuildSExt(b,v_tmp_loaddata,TypeSizeT,"");
683683

684684
LLVMBuildStore(b,v_tmp_loaddata,v_resultp);
685685
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp