blob: e0e402bafab15d813ab13170bf8b13a29568ed27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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,
|