Skip to content

Commit db938cc

Browse files
committed
PGPRO-8546: Add core patch for REL_11_STABLE. Don't generate deforming jit code for tuples without user attributes. Without this patch an "ERROR: unknown alignment" may occur during jit compilation.
Tags: pg_pathman
1 parent 789e111 commit db938cc

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ The `pg_pathman` module provides optimized partitioning mechanism and functions
1313

1414
The extension is compatible with:
1515

16-
* PostgreSQL 11, 12, 13;
17-
* PostgreSQL with core-patch: 14, 15;
16+
* PostgreSQL 12, 13;
17+
* PostgreSQL with core-patch: 11, 14, 15;
1818
* Postgres Pro Standard 11, 12, 13, 14, 15;
1919
* Postgres Pro Enterprise;
2020

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/src/backend/jit/llvm/llvmjit_deform.c b/src/backend/jit/llvm/llvmjit_deform.c
2+
index 6384ac940d8..8b4f731e7a8 100644
3+
--- a/src/backend/jit/llvm/llvmjit_deform.c
4+
+++ b/src/backend/jit/llvm/llvmjit_deform.c
5+
@@ -104,6 +104,10 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
6+
7+
int attnum;
8+
9+
+ /* don't generate code for tuples without user attributes */
10+
+ if (desc->natts == 0)
11+
+ return NULL;
12+
+
13+
mod = llvm_mutable_module(context);
14+
15+
funcname = llvm_expand_funcname(context, "deform");
16+
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c
17+
index 12138e49577..8638ebc4ba1 100644
18+
--- a/src/backend/jit/llvm/llvmjit_expr.c
19+
+++ b/src/backend/jit/llvm/llvmjit_expr.c
20+
@@ -274,6 +274,7 @@ llvm_compile_expr(ExprState *state)
21+
LLVMValueRef v_slot;
22+
LLVMBasicBlockRef b_fetch;
23+
LLVMValueRef v_nvalid;
24+
+ LLVMValueRef l_jit_deform = NULL;
25+
26+
b_fetch = l_bb_before_v(opblocks[i + 1],
27+
"op.%d.fetch", i);
28+
@@ -336,17 +337,20 @@ llvm_compile_expr(ExprState *state)
29+
*/
30+
if (desc && (context->base.flags & PGJIT_DEFORM))
31+
{
32+
- LLVMValueRef params[1];
33+
- LLVMValueRef l_jit_deform;
34+
-
35+
l_jit_deform =
36+
- slot_compile_deform(context, desc,
37+
+ slot_compile_deform(context,
38+
+ desc,
39+
op->d.fetch.last_var);
40+
+ }
41+
+
42+
+ if (l_jit_deform)
43+
+ {
44+
+ LLVMValueRef params[1];
45+
+
46+
params[0] = v_slot;
47+
48+
LLVMBuildCall(b, l_jit_deform,
49+
params, lengthof(params), "");
50+
-
51+
}
52+
else
53+
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy