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

Commita598708

Browse files
committed
Change TupleTableSlot->tts_nvalid to type AttrNumber.
Previously it was an int / 4 bytes. The maximum number of attributesin a tuple is restricted by the maximum value Var->varattno, which isan AttrNumber/int16. Hence use the same data type forTupleTableSlot->tts_nvalid.Author: Ashutosh BapatDiscussion:https://postgr.es/m/20180220224318.gw4oe5jadhpmcdnm@alap3.anarazel.de
1 parent5913b9b commita598708

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
304304

305305
for (attnum=0;attnum<natts;attnum++)
306306
{
307-
LLVMValueRefv_attno=l_int32_const(attnum);
307+
LLVMValueRefv_attno=l_int16_const(attnum);
308308

309309
LLVMAddCase(v_switch,v_attno,attcheckattnoblocks[attnum]);
310310
}
@@ -691,7 +691,7 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
691691
{
692692
LLVMValueRefv_off=LLVMBuildLoad(b,v_offp,"");
693693

694-
LLVMBuildStore(b,l_int32_const(natts),v_nvalidp);
694+
LLVMBuildStore(b,l_int16_const(natts),v_nvalidp);
695695
v_off=LLVMBuildTrunc(b,v_off,LLVMInt32Type(),"");
696696
LLVMBuildStore(b,v_off,v_slotoffp);
697697
LLVMBuildStore(b,l_int8_const(1),v_slowp);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ llvm_compile_expr(ExprState *state)
324324
"");
325325
LLVMBuildCondBr(b,
326326
LLVMBuildICmp(b,LLVMIntUGE,v_nvalid,
327-
l_int32_const(op->d.fetch.last_var),
327+
l_int16_const(op->d.fetch.last_var),
328328
""),
329329
opblocks[i+1],b_fetch);
330330

‎src/include/executor/tuptable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ typedef struct TupleTableSlot
125125
MemoryContexttts_mcxt;/* slot itself is in this context */
126126
Buffertts_buffer;/* tuple's buffer, or InvalidBuffer */
127127
#defineFIELDNO_TUPLETABLESLOT_NVALID 9
128-
inttts_nvalid;/* # of valid values in tts_values */
128+
AttrNumbertts_nvalid;/* # of valid values in tts_values */
129129
#defineFIELDNO_TUPLETABLESLOT_VALUES 10
130130
Datum*tts_values;/* current per-attribute values */
131131
#defineFIELDNO_TUPLETABLESLOT_ISNULL 11

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp