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

Appearance settings

Commit a598708

Browse filesBrowse files
committed
Change TupleTableSlot->tts_nvalid to type AttrNumber.
Previously it was an int / 4 bytes. The maximum number of attributes in a tuple is restricted by the maximum value Var->varattno, which is an AttrNumber/int16. Hence use the same data type for TupleTableSlot->tts_nvalid. Author: Ashutosh Bapat Discussion: https://postgr.es/m/20180220224318.gw4oe5jadhpmcdnm@alap3.anarazel.de
1 parent 5913b9b commit a598708
Copy full SHA for a598708

File tree

Expand file treeCollapse file tree

3 files changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+4
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/backend/jit/llvm/llvmjit_deform.c
+2-2Lines 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-
LLVMValueRef v_attno = l_int32_const(attnum);
307+
LLVMValueRef v_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
LLVMValueRef v_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

Copy file name to clipboardExpand all lines: src/backend/jit/llvm/llvmjit_expr.c
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/include/executor/tuptable.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ typedef struct TupleTableSlot
125125
MemoryContext tts_mcxt; /* slot itself is in this context */
126126
Buffer tts_buffer; /* tuple's buffer, or InvalidBuffer */
127127
#define FIELDNO_TUPLETABLESLOT_NVALID 9
128-
int tts_nvalid; /* # of valid values in tts_values */
128+
AttrNumber tts_nvalid; /* # of valid values in tts_values */
129129
#define FIELDNO_TUPLETABLESLOT_VALUES 10
130130
Datum *tts_values; /* current per-attribute values */
131131
#define FIELDNO_TUPLETABLESLOT_ISNULL 11

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.