Compare commits
10 Commits
6182464647
...
26f28e0c28
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26f28e0c28 | ||
|
|
6a00953803 | ||
|
|
40db556fc9 | ||
|
|
13fbb6ecb0 | ||
|
|
270022e4fb | ||
|
|
b5b450ab70 | ||
|
|
218c969d62 | ||
|
|
15060e4aa8 | ||
|
|
5c4eac2018 | ||
|
|
b1cdc863dd |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
2
.lfsconfig
Normal file
2
.lfsconfig
Normal file
@ -0,0 +1,2 @@
|
||||
[lfs]
|
||||
url = https://artlfs.openeuler.openatom.cn/src-openEuler/libpq
|
||||
80
add-sw_64-support.patch
Normal file
80
add-sw_64-support.patch
Normal file
@ -0,0 +1,80 @@
|
||||
From ed05d50b808df2bb0d11456515896a40e620389b Mon Sep 17 00:00:00 2001
|
||||
From: mahailiang <mahailiang@uniontech.com>
|
||||
Date: Sat, 15 Mar 2025 11:46:26 +0800
|
||||
Subject: [PATCH] add sw_64 support
|
||||
|
||||
---
|
||||
contrib/pgcrypto/crypt-blowfish.c | 2 +-
|
||||
src/include/storage/s_lock.h | 43 +++++++++++++++++++++++++++++++
|
||||
2 files changed, 44 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/contrib/pgcrypto/crypt-blowfish.c b/contrib/pgcrypto/crypt-blowfish.c
|
||||
index a663852..e6d72b2 100644
|
||||
--- a/contrib/pgcrypto/crypt-blowfish.c
|
||||
+++ b/contrib/pgcrypto/crypt-blowfish.c
|
||||
@@ -41,7 +41,7 @@
|
||||
#ifdef __i386__
|
||||
#define BF_ASM 0 /* 1 */
|
||||
#define BF_SCALE 1
|
||||
-#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__)
|
||||
+#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) || defined(__sw_64__)
|
||||
#define BF_ASM 0
|
||||
#define BF_SCALE 1
|
||||
#else
|
||||
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
|
||||
index 1ada0a8..3afd20e 100644
|
||||
--- a/src/include/storage/s_lock.h
|
||||
+++ b/src/include/storage/s_lock.h
|
||||
@@ -771,6 +771,49 @@ tas(volatile slock_t *lock)
|
||||
|
||||
#endif /* __sh__ */
|
||||
|
||||
+#if defined(__sw_64) || defined(__sw_64__) /* sw_64 */
|
||||
+#define HAS_TEST_AND_SET
|
||||
+
|
||||
+typedef unsigned long slock_t;
|
||||
+
|
||||
+#define TAS(lock) tas(lock)
|
||||
+
|
||||
+static __inline__ int
|
||||
+tas(volatile slock_t *lock)
|
||||
+{
|
||||
+ register slock_t _res;
|
||||
+ unsigned long tmp;
|
||||
+ __asm__ __volatile__(
|
||||
+ " ldl $0, %1 \n"
|
||||
+ " bne $0, 2f \n"
|
||||
+ " ldi %2, %1\n"
|
||||
+ " lldl %0, 0(%2) \n"
|
||||
+ " mov 1, $0 \n"
|
||||
+ " wr_f $0 \n"
|
||||
+ " memb \n"
|
||||
+ " lstl $0, 0(%2) \n"
|
||||
+ " rd_f $0 \n"
|
||||
+ " bne %0, 2f \n"
|
||||
+ " beq $0, 2f \n"
|
||||
+ " memb \n"
|
||||
+ " br 3f \n"
|
||||
+ "2: mov 1, %0 \n"
|
||||
+ "3: \n"
|
||||
+: "=&r"(_res), "+m"(*lock),"=r" (tmp)
|
||||
+:
|
||||
+: "memory", "0");
|
||||
+ return (int) _res;
|
||||
+}
|
||||
+
|
||||
+#define S_UNLOCK(lock) \
|
||||
+do \
|
||||
+{\
|
||||
+ __asm__ __volatile__ (" memb \n"); \
|
||||
+ *((volatile slock_t *) (lock)) = 0; \
|
||||
+} while (0)
|
||||
+
|
||||
+#endif /* __sw_64 || __sw_64__ */
|
||||
+
|
||||
|
||||
/* These live in s_lock.c, but only for gcc */
|
||||
|
||||
--
|
||||
2.43.5
|
||||
|
||||
@ -1,129 +0,0 @@
|
||||
From 6e29963edd55cfc038304322049d8fe697580f2c Mon Sep 17 00:00:00 2001
|
||||
From: Tom Lane <tgl@sss.pgh.pa.us>
|
||||
Date: Thu, 9 May 2024 13:16:21 -0400
|
||||
Subject: [PATCH] Fix recursive RECORD-returning plpython functions.
|
||||
|
||||
If we recursed to a new call of the same function, with a different
|
||||
coldeflist (AS clause), it would fail because the inner call would
|
||||
overwrite the outer call's idea of what to return. This is vaguely
|
||||
like 1d2fe56e4 and c5bec5426, but it's not due to any API decisions:
|
||||
it's just that we computed the actual output rowtype at the start of
|
||||
the call, and saved it in the per-procedure data structure. We can
|
||||
fix it at basically zero cost by doing the computation at the end
|
||||
of each call instead of the start.
|
||||
|
||||
It's not clear that there's any real-world use-case for such a
|
||||
function, but given that it doesn't cost anything to fix,
|
||||
it'd be silly not to.
|
||||
|
||||
Per report from Andreas Karlsson. Back-patch to all supported
|
||||
branches.
|
||||
|
||||
Discussion: https://postgr.es/m/1651a46d-3c15-4028-a8c1-d74937b54e19@proxel.se
|
||||
---
|
||||
.../plpython/expected/plpython_composite.out | 14 ++++++++
|
||||
src/pl/plpython/plpy_exec.c | 33 ++++++++++---------
|
||||
src/pl/plpython/sql/plpython_composite.sql | 11 +++++++
|
||||
3 files changed, 42 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/pl/plpython/expected/plpython_composite.out b/src/pl/plpython/expected/plpython_composite.out
|
||||
index bb101e0..674af93 100644
|
||||
--- a/src/pl/plpython/expected/plpython_composite.out
|
||||
+++ b/src/pl/plpython/expected/plpython_composite.out
|
||||
@@ -569,6 +569,20 @@ SELECT * FROM return_record_2('v3') AS (v1 int, v2 int, v3 int);
|
||||
1 | 2 | 3
|
||||
(1 row)
|
||||
|
||||
+-- recursion with a different inner result type didn't use to work
|
||||
+CREATE FUNCTION return_record_3(t text) RETURNS record AS $$
|
||||
+if t == "text":
|
||||
+ plpy.execute("SELECT * FROM return_record_3('int') AS (a int)");
|
||||
+ return { "a": "x" }
|
||||
+elif t == "int":
|
||||
+ return { "a": 1 }
|
||||
+$$ LANGUAGE plpython3u;
|
||||
+SELECT * FROM return_record_3('text') AS (a text);
|
||||
+ a
|
||||
+---
|
||||
+ x
|
||||
+(1 row)
|
||||
+
|
||||
-- multi-dimensional array of composite types.
|
||||
CREATE FUNCTION composite_type_as_list() RETURNS type_record[] AS $$
|
||||
return [[('first', 1), ('second', 1)], [('first', 2), ('second', 2)], [('first', 3), ('second', 3)]];
|
||||
diff --git a/src/pl/plpython/plpy_exec.c b/src/pl/plpython/plpy_exec.c
|
||||
index 993a4e2..517b1fe 100644
|
||||
--- a/src/pl/plpython/plpy_exec.c
|
||||
+++ b/src/pl/plpython/plpy_exec.c
|
||||
@@ -231,7 +231,23 @@ PLy_exec_function(FunctionCallInfo fcinfo, PLyProcedure *proc)
|
||||
}
|
||||
else
|
||||
{
|
||||
- /* Normal conversion of result */
|
||||
+ /*
|
||||
+ * Normal conversion of result. However, if the result is of type
|
||||
+ * RECORD, we have to set up for that each time through, since it
|
||||
+ * might be different from last time.
|
||||
+ */
|
||||
+ if (proc->result.typoid == RECORDOID)
|
||||
+ {
|
||||
+ TupleDesc desc;
|
||||
+
|
||||
+ if (get_call_result_type(fcinfo, NULL, &desc) != TYPEFUNC_COMPOSITE)
|
||||
+ ereport(ERROR,
|
||||
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
+ errmsg("function returning record called in context "
|
||||
+ "that cannot accept type record")));
|
||||
+ PLy_output_setup_record(&proc->result, desc, proc);
|
||||
+ }
|
||||
+
|
||||
rv = PLy_output_convert(&proc->result, plrv,
|
||||
&fcinfo->isnull);
|
||||
}
|
||||
@@ -450,21 +466,6 @@ PLy_function_build_args(FunctionCallInfo fcinfo, PLyProcedure *proc)
|
||||
PLy_elog(ERROR, "PyDict_SetItemString() failed, while setting up arguments");
|
||||
arg = NULL;
|
||||
}
|
||||
-
|
||||
- /* Set up output conversion for functions returning RECORD */
|
||||
- if (proc->result.typoid == RECORDOID)
|
||||
- {
|
||||
- TupleDesc desc;
|
||||
-
|
||||
- if (get_call_result_type(fcinfo, NULL, &desc) != TYPEFUNC_COMPOSITE)
|
||||
- ereport(ERROR,
|
||||
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
- errmsg("function returning record called in context "
|
||||
- "that cannot accept type record")));
|
||||
-
|
||||
- /* cache the output conversion functions */
|
||||
- PLy_output_setup_record(&proc->result, desc, proc);
|
||||
- }
|
||||
}
|
||||
PG_CATCH();
|
||||
{
|
||||
diff --git a/src/pl/plpython/sql/plpython_composite.sql b/src/pl/plpython/sql/plpython_composite.sql
|
||||
index 2175770..1bb9b83 100644
|
||||
--- a/src/pl/plpython/sql/plpython_composite.sql
|
||||
+++ b/src/pl/plpython/sql/plpython_composite.sql
|
||||
@@ -208,6 +208,17 @@ SELECT * FROM return_record_2('v4') AS (v1 int, v3 int, v2 int);
|
||||
SELECT * FROM return_record_2('v3') AS (v1 int, v3 int, v2 int);
|
||||
SELECT * FROM return_record_2('v3') AS (v1 int, v2 int, v3 int);
|
||||
|
||||
+-- recursion with a different inner result type didn't use to work
|
||||
+CREATE FUNCTION return_record_3(t text) RETURNS record AS $$
|
||||
+if t == "text":
|
||||
+ plpy.execute("SELECT * FROM return_record_3('int') AS (a int)");
|
||||
+ return { "a": "x" }
|
||||
+elif t == "int":
|
||||
+ return { "a": 1 }
|
||||
+$$ LANGUAGE plpython3u;
|
||||
+
|
||||
+SELECT * FROM return_record_3('text') AS (a text);
|
||||
+
|
||||
-- multi-dimensional array of composite types.
|
||||
CREATE FUNCTION composite_type_as_list() RETURNS type_record[] AS $$
|
||||
return [[('first', 1), ('second', 1)], [('first', 2), ('second', 2)], [('first', 3), ('second', 3)]];
|
||||
--
|
||||
2.27.0
|
||||
|
||||
21
libpq.spec
21
libpq.spec
@ -1,6 +1,6 @@
|
||||
Name: libpq
|
||||
Version: 15.6
|
||||
Release: 2
|
||||
Version: 15.13
|
||||
Release: 1
|
||||
Summary: PostgreSQL client library
|
||||
License: PostgreSQL
|
||||
Url: http://www.postgresql.org/
|
||||
@ -10,7 +10,7 @@ Patch0001: libpq-10.3-rpm-pgsql.patch
|
||||
Patch0002: libpq-10.3-var-run-socket.patch
|
||||
Patch0003: libpq-12.1-symbol-versioning.patch
|
||||
Patch0004: add-loongarch-support.patch
|
||||
Patch0005: fix-CVE-2024-4317.patch
|
||||
Patch0005: add-sw_64-support.patch
|
||||
|
||||
BuildRequires: gcc glibc-devel bison flex gawk zlib-devel openssl-devel
|
||||
BuildRequires: krb5-devel openldap-devel gettext multilib-rpm-config
|
||||
@ -81,6 +81,21 @@ cat pg_config-15.lang >>libpq-devel.lst
|
||||
%_libdir/pkgconfig/libpq.pc
|
||||
|
||||
%changelog
|
||||
* Fri May 09 2025 Funda Wang <fundawang@yeah.net> - 15.13-1
|
||||
- update to version 15.13
|
||||
|
||||
* Sat Mar 15 2025 mahailiang <mahailiang@uniontech.com> - 15.12-2
|
||||
- add sw_64 support
|
||||
|
||||
* Thu Feb 20 2025 Funda Wang <fundawang@yeah.net> - 15.12-1
|
||||
- update to 15.12 to fix CVE-2025-1094
|
||||
|
||||
* Fri Nov 15 2024 Funda Wang <fundawang@yeah.net> - 15.9-1
|
||||
- update to 15.9
|
||||
|
||||
* Fri Aug 09 2024 Funda Wang <fundawang@yeah.net> - 15.8-1
|
||||
- update to 15.8
|
||||
|
||||
* Fri May 10 2024 qz_cx wangqingzheng@kylinos.cn - 15.6-2
|
||||
- Type:CVE
|
||||
- ID:NA
|
||||
|
||||
3
postgresql-15.13.tar.bz2
Normal file
3
postgresql-15.13.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4f62e133d22ea08a0401b0840920e26698644d01a80c34341fb732dd0a90ca5d
|
||||
size 23190593
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user