summaryrefslogtreecommitdiffstats
path: root/openswoole-pg9.patch
diff options
context:
space:
mode:
Diffstat (limited to 'openswoole-pg9.patch')
-rw-r--r--openswoole-pg9.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/openswoole-pg9.patch b/openswoole-pg9.patch
new file mode 100644
index 0000000..e0e402b
--- /dev/null
+++ b/openswoole-pg9.patch
@@ -0,0 +1,36 @@
+From 21d86e3d6d62b70ffc9ecc22e651f15162c462f3 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 29 Nov 2021 07:29:22 +0100
+Subject: [PATCH] fix build with postgresql 9
+
+---
+ ext-src/swoole_postgres_coro.cc | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/ext-src/swoole_postgres_coro.cc b/ext-src/swoole_postgres_coro.cc
+index 06362e6f0..11e467225 100644
+--- a/ext-src/swoole_postgres_coro.cc
++++ b/ext-src/swoole_postgres_coro.cc
+@@ -539,6 +539,22 @@ static int meta_data_result_parse(PGObject *object) {
+ return SW_OK;
+ }
+
++#ifndef PG_DIAG_SCHEMA_NAME
++# define PG_DIAG_SCHEMA_NAME 's'
++#endif
++#ifndef PG_DIAG_TABLE_NAME
++# define PG_DIAG_TABLE_NAME 't'
++#endif
++#ifndef PG_DIAG_COLUMN_NAME
++# define PG_DIAG_COLUMN_NAME 'c'
++#endif
++#ifndef PG_DIAG_DATATYPE_NAME
++# define PG_DIAG_DATATYPE_NAME 'd'
++#endif
++#ifndef PG_DIAG_CONSTRAINT_NAME
++# define PG_DIAG_CONSTRAINT_NAME 'n'
++#endif
++
+ static void set_error_diag(const PGObject *object, const PGresult *pgsql_result) {
+ const unsigned int error_codes[] = {PG_DIAG_SEVERITY,
+ PG_DIAG_SQLSTATE,