Skip to content

Commit a59bf37

Browse files
authored
Merge pull request IvorySQL#833 from NotHimmel/sync_pg_14.18
Merge pg14.18
2 parents fde5539 + 29012b2 commit a59bf37

140 files changed

Lines changed: 12464 additions & 9210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

configure

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for PostgreSQL 14.17.
3+
# Generated by GNU Autoconf 2.69 for PostgreSQL 14.18.
44
#
55
# Report bugs to <pgsql-bugs@lists.postgresql.org>.
66
#
@@ -582,8 +582,8 @@ MAKEFLAGS=
582582
# Identity of this package.
583583
PACKAGE_NAME='PostgreSQL'
584584
PACKAGE_TARNAME='postgresql'
585-
PACKAGE_VERSION='14.17'
586-
PACKAGE_STRING='PostgreSQL 14.17'
585+
PACKAGE_VERSION='14.18'
586+
PACKAGE_STRING='PostgreSQL 14.18'
587587
PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org'
588588
PACKAGE_URL='https://www.postgresql.org/'
589589

@@ -1446,7 +1446,7 @@ if test "$ac_init_help" = "long"; then
14461446
# Omit some internal or obsolete options to make the list less imposing.
14471447
# This message is too long to be a string in the A/UX 3.1 sh.
14481448
cat <<_ACEOF
1449-
\`configure' configures PostgreSQL 14.17 to adapt to many kinds of systems.
1449+
\`configure' configures PostgreSQL 14.18 to adapt to many kinds of systems.
14501450

14511451
Usage: $0 [OPTION]... [VAR=VALUE]...
14521452

@@ -1511,7 +1511,7 @@ fi
15111511

15121512
if test -n "$ac_init_help"; then
15131513
case $ac_init_help in
1514-
short | recursive ) echo "Configuration of PostgreSQL 14.17:";;
1514+
short | recursive ) echo "Configuration of PostgreSQL 14.18:";;
15151515
esac
15161516
cat <<\_ACEOF
15171517

@@ -1685,7 +1685,7 @@ fi
16851685
test -n "$ac_init_help" && exit $ac_status
16861686
if $ac_init_version; then
16871687
cat <<\_ACEOF
1688-
PostgreSQL configure 14.17
1688+
PostgreSQL configure 14.18
16891689
generated by GNU Autoconf 2.69
16901690

16911691
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2438,7 +2438,7 @@ cat >config.log <<_ACEOF
24382438
This file contains any messages produced by compilers while
24392439
running configure, to aid debugging if configure makes a mistake.
24402440

2441-
It was created by PostgreSQL $as_me 14.17, which was
2441+
It was created by PostgreSQL $as_me 14.18, which was
24422442
generated by GNU Autoconf 2.69. Invocation command line was
24432443

24442444
$ $0 $@
@@ -2827,7 +2827,7 @@ _ACEOF
28272827

28282828

28292829
# IvorySQL version
2830-
PACKAGE_IVORYSQL_VERSION='1.17'
2830+
PACKAGE_IVORYSQL_VERSION='1.18'
28312831

28322832
PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
28332833
PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`
@@ -16168,7 +16168,7 @@ fi
1616816168
LIBS_including_readline="$LIBS"
1616916169
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
1617016170

16171-
for ac_func in backtrace_symbols clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit kqueue mbstowcs_l memset_s poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink readv setproctitle setproctitle_fast setsid shm_open strchrnul strsignal symlink syncfs sync_file_range uselocale wcstombs_l writev
16171+
for ac_func in backtrace_symbols clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit kqueue mbstowcs_l memset_s poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink readv setproctitle setproctitle_fast setsid shm_open strsignal symlink syncfs sync_file_range uselocale wcstombs_l writev
1617216172
do :
1617316173
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1617416174
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16732,6 +16732,18 @@ esac
1673216732

1673316733
fi
1673416734

16735+
ac_fn_c_check_decl "$LINENO" "strchrnul" "ac_cv_have_decl_strchrnul" "#include <string.h>
16736+
"
16737+
if test "x$ac_cv_have_decl_strchrnul" = xyes; then :
16738+
ac_have_decl=1
16739+
else
16740+
ac_have_decl=0
16741+
fi
16742+
16743+
cat >>confdefs.h <<_ACEOF
16744+
#define HAVE_DECL_STRCHRNUL $ac_have_decl
16745+
_ACEOF
16746+
1673516747

1673616748
# This is probably only present on macOS, but may as well check always
1673716749
ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
@@ -20782,7 +20794,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2078220794
# report actual input values of CONFIG_FILES etc. instead of their
2078320795
# values after options handling.
2078420796
ac_log="
20785-
This file was extended by PostgreSQL $as_me 14.17, which was
20797+
This file was extended by PostgreSQL $as_me 14.18, which was
2078620798
generated by GNU Autoconf 2.69. Invocation command line was
2078720799

2078820800
CONFIG_FILES = $CONFIG_FILES
@@ -20853,7 +20865,7 @@ _ACEOF
2085320865
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2085420866
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2085520867
ac_cs_version="\\
20856-
PostgreSQL config.status 14.17
20868+
PostgreSQL config.status 14.18
2085720869
configured by $0, generated by GNU Autoconf 2.69,
2085820870
with options \\"\$ac_cs_config\\"
2085920871

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
1717
dnl
1818
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
1919

20-
AC_INIT([PostgreSQL], [14.17], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
20+
AC_INIT([PostgreSQL], [14.18], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
2121

2222
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
2323
Untested combinations of 'autoconf' and PostgreSQL versions are not
@@ -30,7 +30,7 @@ AC_PREFIX_DEFAULT(/usr/local/pgsql)
3030
AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["$ac_configure_args"], [Saved arguments from configure])
3131

3232
# IvorySQL version
33-
PACKAGE_IVORYSQL_VERSION='1.17'
33+
PACKAGE_IVORYSQL_VERSION='1.18'
3434

3535
[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`]
3636
[PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`]
@@ -1811,7 +1811,6 @@ AC_CHECK_FUNCS(m4_normalize([
18111811
setproctitle_fast
18121812
setsid
18131813
shm_open
1814-
strchrnul
18151814
strsignal
18161815
symlink
18171816
syncfs
@@ -1853,6 +1852,7 @@ AC_CHECK_DECLS([strlcat, strlcpy, strnlen])
18531852
# won't handle deployment target restrictions on macOS
18541853
AC_CHECK_DECLS([preadv], [], [AC_LIBOBJ(preadv)], [#include <sys/uio.h>])
18551854
AC_CHECK_DECLS([pwritev], [], [AC_LIBOBJ(pwritev)], [#include <sys/uio.h>])
1855+
AC_CHECK_DECLS([strchrnul], [], [], [#include <string.h>])
18561856

18571857
# This is probably only present on macOS, but may as well check always
18581858
AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>])

contrib/dblink/dblink.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "funcapi.h"
4949
#include "lib/stringinfo.h"
5050
#include "libpq-fe.h"
51+
#include "libpq/libpq-be-fe-helpers.h"
5152
#include "mb/pg_wchar.h"
5253
#include "miscadmin.h"
5354
#include "parser/scansup.h"
@@ -59,6 +60,7 @@
5960
#include "utils/memutils.h"
6061
#include "utils/rel.h"
6162
#include "utils/varlena.h"
63+
#include "utils/wait_event.h"
6264

6365
PG_MODULE_MAGIC;
6466

@@ -478,7 +480,7 @@ dblink_open(PG_FUNCTION_ARGS)
478480
/* If we are not in a transaction, start one */
479481
if (PQtransactionStatus(conn) == PQTRANS_IDLE)
480482
{
481-
res = PQexec(conn, "BEGIN");
483+
res = libpqsrv_exec(conn, "BEGIN", PG_WAIT_EXTENSION);
482484
if (PQresultStatus(res) != PGRES_COMMAND_OK)
483485
dblink_res_internalerror(conn, res, "begin error");
484486
PQclear(res);
@@ -497,7 +499,7 @@ dblink_open(PG_FUNCTION_ARGS)
497499
(rconn->openCursorCount)++;
498500

499501
appendStringInfo(&buf, "DECLARE %s CURSOR FOR %s", curname, sql);
500-
res = PQexec(conn, buf.data);
502+
res = libpqsrv_exec(conn, buf.data, PG_WAIT_EXTENSION);
501503
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
502504
{
503505
dblink_res_error(conn, conname, res, fail,
@@ -566,7 +568,7 @@ dblink_close(PG_FUNCTION_ARGS)
566568
appendStringInfo(&buf, "CLOSE %s", curname);
567569

568570
/* close the cursor */
569-
res = PQexec(conn, buf.data);
571+
res = libpqsrv_exec(conn, buf.data, PG_WAIT_EXTENSION);
570572
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
571573
{
572574
dblink_res_error(conn, conname, res, fail,
@@ -586,7 +588,7 @@ dblink_close(PG_FUNCTION_ARGS)
586588
{
587589
rconn->newXactForCursor = false;
588590

589-
res = PQexec(conn, "COMMIT");
591+
res = libpqsrv_exec(conn, "COMMIT", PG_WAIT_EXTENSION);
590592
if (PQresultStatus(res) != PGRES_COMMAND_OK)
591593
dblink_res_internalerror(conn, res, "commit error");
592594
PQclear(res);
@@ -668,7 +670,7 @@ dblink_fetch(PG_FUNCTION_ARGS)
668670
* PGresult will be long-lived even though we are still in a short-lived
669671
* memory context.
670672
*/
671-
res = PQexec(conn, buf.data);
673+
res = libpqsrv_exec(conn, buf.data, PG_WAIT_EXTENSION);
672674
if (!res ||
673675
(PQresultStatus(res) != PGRES_COMMAND_OK &&
674676
PQresultStatus(res) != PGRES_TUPLES_OK))
@@ -816,7 +818,7 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
816818
else
817819
{
818820
/* async result retrieval, do it the old way */
819-
PGresult *res = PQgetResult(conn);
821+
PGresult *res = libpqsrv_get_result(conn, PG_WAIT_EXTENSION);
820822

821823
/* NULL means we're all done with the async results */
822824
if (res)
@@ -1130,7 +1132,8 @@ materializeQueryResult(FunctionCallInfo fcinfo,
11301132
PQclear(sinfo.last_res);
11311133
PQclear(sinfo.cur_res);
11321134
/* and clear out any pending data in libpq */
1133-
while ((res = PQgetResult(conn)) != NULL)
1135+
while ((res = libpqsrv_get_result(conn, PG_WAIT_EXTENSION)) !=
1136+
NULL)
11341137
PQclear(res);
11351138
PG_RE_THROW();
11361139
}
@@ -1157,7 +1160,7 @@ storeQueryResult(volatile storeInfo *sinfo, PGconn *conn, const char *sql)
11571160
{
11581161
CHECK_FOR_INTERRUPTS();
11591162

1160-
sinfo->cur_res = PQgetResult(conn);
1163+
sinfo->cur_res = libpqsrv_get_result(conn, PG_WAIT_EXTENSION);
11611164
if (!sinfo->cur_res)
11621165
break;
11631166

@@ -1485,7 +1488,7 @@ dblink_exec(PG_FUNCTION_ARGS)
14851488
if (!conn)
14861489
dblink_conn_not_avail(conname);
14871490

1488-
res = PQexec(conn, sql);
1491+
res = libpqsrv_exec(conn, sql, PG_WAIT_EXTENSION);
14891492
if (!res ||
14901493
(PQresultStatus(res) != PGRES_COMMAND_OK &&
14911494
PQresultStatus(res) != PGRES_TUPLES_OK))
@@ -2771,8 +2774,8 @@ dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
27712774

27722775
/*
27732776
* If we don't get a message from the PGresult, try the PGconn. This is
2774-
* needed because for connection-level failures, PQexec may just return
2775-
* NULL, not a PGresult at all.
2777+
* needed because for connection-level failures, PQgetResult may just
2778+
* return NULL, not a PGresult at all.
27762779
*/
27772780
if (message_primary == NULL)
27782781
message_primary = pchomp(PQerrorMessage(conn));

contrib/intarray/expected/_int.out

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,12 @@ SELECT count(*) from test__int WHERE a @@ '!20 & !21';
473473
6344
474474
(1 row)
475475

476+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
477+
count
478+
-------
479+
12
480+
(1 row)
481+
476482
SET enable_seqscan = off; -- not all of these would use index by default
477483
CREATE INDEX text_idx on test__int using gist ( a gist__int_ops );
478484
SELECT count(*) from test__int WHERE a && '{23,50}';
@@ -547,6 +553,12 @@ SELECT count(*) from test__int WHERE a @@ '!20 & !21';
547553
6344
548554
(1 row)
549555

556+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
557+
count
558+
-------
559+
12
560+
(1 row)
561+
550562
INSERT INTO test__int SELECT array(SELECT x FROM generate_series(1, 1001) x); -- should fail
551563
ERROR: input array is too big (199 maximum allowed, 1001 current), use gist__intbig_ops opclass instead
552564
DROP INDEX text_idx;
@@ -629,6 +641,12 @@ SELECT count(*) from test__int WHERE a @@ '!20 & !21';
629641
6344
630642
(1 row)
631643

644+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
645+
count
646+
-------
647+
12
648+
(1 row)
649+
632650
DROP INDEX text_idx;
633651
CREATE INDEX text_idx on test__int using gist (a gist__intbig_ops(siglen = 0));
634652
ERROR: value 0 out of bounds for option "siglen"
@@ -709,6 +727,12 @@ SELECT count(*) from test__int WHERE a @@ '!20 & !21';
709727
6344
710728
(1 row)
711729

730+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
731+
count
732+
-------
733+
12
734+
(1 row)
735+
712736
DROP INDEX text_idx;
713737
CREATE INDEX text_idx on test__int using gist ( a gist__intbig_ops );
714738
SELECT count(*) from test__int WHERE a && '{23,50}';
@@ -783,6 +807,12 @@ SELECT count(*) from test__int WHERE a @@ '!20 & !21';
783807
6344
784808
(1 row)
785809

810+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
811+
count
812+
-------
813+
12
814+
(1 row)
815+
786816
DROP INDEX text_idx;
787817
CREATE INDEX text_idx on test__int using gin ( a gin__int_ops );
788818
SELECT count(*) from test__int WHERE a && '{23,50}';
@@ -857,6 +887,12 @@ SELECT count(*) from test__int WHERE a @@ '!20 & !21';
857887
6344
858888
(1 row)
859889

890+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
891+
count
892+
-------
893+
12
894+
(1 row)
895+
860896
DROP INDEX text_idx;
861897
-- Repeat the same queries with an extended data set. The data set is the
862898
-- same that we used before, except that each element in the array is
@@ -949,4 +985,10 @@ SELECT count(*) from more__int WHERE a @@ '!20 & !21';
949985
6344
950986
(1 row)
951987

988+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
989+
count
990+
-------
991+
12
992+
(1 row)
993+
952994
RESET enable_seqscan;

contrib/intarray/sql/_int.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ SELECT count(*) from test__int WHERE a @> '{20,23}' or a @> '{50,68}';
9292
SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
9393
SELECT count(*) from test__int WHERE a @@ '20 | !21';
9494
SELECT count(*) from test__int WHERE a @@ '!20 & !21';
95+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
9596

9697
SET enable_seqscan = off; -- not all of these would use index by default
9798

@@ -109,6 +110,7 @@ SELECT count(*) from test__int WHERE a @> '{20,23}' or a @> '{50,68}';
109110
SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
110111
SELECT count(*) from test__int WHERE a @@ '20 | !21';
111112
SELECT count(*) from test__int WHERE a @@ '!20 & !21';
113+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
112114

113115
INSERT INTO test__int SELECT array(SELECT x FROM generate_series(1, 1001) x); -- should fail
114116

@@ -129,6 +131,7 @@ SELECT count(*) from test__int WHERE a @> '{20,23}' or a @> '{50,68}';
129131
SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
130132
SELECT count(*) from test__int WHERE a @@ '20 | !21';
131133
SELECT count(*) from test__int WHERE a @@ '!20 & !21';
134+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
132135

133136
DROP INDEX text_idx;
134137
CREATE INDEX text_idx on test__int using gist (a gist__intbig_ops(siglen = 0));
@@ -147,6 +150,7 @@ SELECT count(*) from test__int WHERE a @> '{20,23}' or a @> '{50,68}';
147150
SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
148151
SELECT count(*) from test__int WHERE a @@ '20 | !21';
149152
SELECT count(*) from test__int WHERE a @@ '!20 & !21';
153+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
150154

151155
DROP INDEX text_idx;
152156
CREATE INDEX text_idx on test__int using gist ( a gist__intbig_ops );
@@ -163,6 +167,7 @@ SELECT count(*) from test__int WHERE a @> '{20,23}' or a @> '{50,68}';
163167
SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
164168
SELECT count(*) from test__int WHERE a @@ '20 | !21';
165169
SELECT count(*) from test__int WHERE a @@ '!20 & !21';
170+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
166171

167172
DROP INDEX text_idx;
168173
CREATE INDEX text_idx on test__int using gin ( a gin__int_ops );
@@ -179,6 +184,7 @@ SELECT count(*) from test__int WHERE a @> '{20,23}' or a @> '{50,68}';
179184
SELECT count(*) from test__int WHERE a @@ '(20&23)|(50&68)';
180185
SELECT count(*) from test__int WHERE a @@ '20 | !21';
181186
SELECT count(*) from test__int WHERE a @@ '!20 & !21';
187+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
182188

183189
DROP INDEX text_idx;
184190

@@ -214,6 +220,7 @@ SELECT count(*) from more__int WHERE a @> '{20,23}' or a @> '{50,68}';
214220
SELECT count(*) from more__int WHERE a @@ '(20&23)|(50&68)';
215221
SELECT count(*) from more__int WHERE a @@ '20 | !21';
216222
SELECT count(*) from more__int WHERE a @@ '!20 & !21';
223+
SELECT count(*) from test__int WHERE a @@ '!2733 & (2738 | 254)';
217224

218225

219226
RESET enable_seqscan;

0 commit comments

Comments
 (0)