Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund2018-09-25 22:59:46 +0000
committerAndres Freund2018-09-25 22:59:46 +0000
commita598708ffa8eb72a22eeee4e6f30bc26e4984acd (patch)
tree7b3bd39e34505898e78ff9275260cf81078c5305 /src/backend
parent5913b9bbf351b421141b300e37752e9ab8d85163 (diff)
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
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/jit/llvm/llvmjit_deform.c4
-rw-r--r--src/backend/jit/llvm/llvmjit_expr.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/jit/llvm/llvmjit_deform.c b/src/backend/jit/llvm/llvmjit_deform.c
index 795f67114e6..6d7ce21865c 100644
--- a/src/backend/jit/llvm/llvmjit_deform.c
+++ b/src/backend/jit/llvm/llvmjit_deform.c
@@ -304,7 +304,7 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
for (attnum = 0; attnum < natts; attnum++)
{
- LLVMValueRef v_attno = l_int32_const(attnum);
+ LLVMValueRef v_attno = l_int16_const(attnum);
LLVMAddCase(v_switch, v_attno, attcheckattnoblocks[attnum]);
}
@@ -691,7 +691,7 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
{
LLVMValueRef v_off = LLVMBuildLoad(b, v_offp, "");
- LLVMBuildStore(b, l_int32_const(natts), v_nvalidp);
+ LLVMBuildStore(b, l_int16_const(natts), v_nvalidp);
v_off = LLVMBuildTrunc(b, v_off, LLVMInt32Type(), "");
LLVMBuildStore(b, v_off, v_slotoffp);
LLVMBuildStore(b, l_int8_const(1), v_slowp);
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c
index 7454d05acaf..99e0cee157f 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -324,7 +324,7 @@ llvm_compile_expr(ExprState *state)
"");
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntUGE, v_nvalid,
- l_int32_const(op->d.fetch.last_var),
+ l_int16_const(op->d.fetch.last_var),
""),
opblocks[i + 1], b_fetch);