Skip to content

Commit e3a16c5

Browse files
committed
Merge branch 'master' into logical_twophase_regresstest
2 parents 60ef2ba + ea69a0d commit e3a16c5

File tree

295 files changed

+9625
-3258
lines changed

Some content is hidden

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

295 files changed

+9625
-3258
lines changed

config/c-compiler.m4

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,33 @@ fi])# PGAC_C_STATIC_ASSERT
178178

179179

180180

181+
# PGAC_C_TYPEOF
182+
# -------------
183+
# Check if the C compiler understands typeof or a variant. Define
184+
# HAVE_TYPEOF if so, and define 'typeof' to the actual key word.
185+
#
186+
AC_DEFUN([PGAC_C_TYPEOF],
187+
[AC_CACHE_CHECK(for typeof, pgac_cv_c_typeof,
188+
[pgac_cv_c_typeof=no
189+
for pgac_kw in typeof __typeof__ decltype; do
190+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
191+
[int x = 0;
192+
$pgac_kw(x) y;
193+
y = x;
194+
return y;])],
195+
[pgac_cv_c_typeof=$pgac_kw])
196+
test "$pgac_cv_c_typeof" != no && break
197+
done])
198+
if test "$pgac_cv_c_typeof" != no; then
199+
AC_DEFINE(HAVE_TYPEOF, 1,
200+
[Define to 1 if your compiler understands `typeof' or something similar.])
201+
if test "$pgac_cv_c_typeof" != typeof; then
202+
AC_DEFINE_UNQUOTED(typeof, $pgac_cv_c_typeof, [Define to how the compiler spells `typeof'.])
203+
fi
204+
fi])# PGAC_C_TYPEOF
205+
206+
207+
181208
# PGAC_C_TYPES_COMPATIBLE
182209
# -----------------------
183210
# Check if the C compiler understands __builtin_types_compatible_p,

configure

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11667,6 +11667,48 @@ if test x"$pgac_cv__static_assert" = xyes ; then
1166711667

1166811668
$as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
1166911669

11670+
fi
11671+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeof" >&5
11672+
$as_echo_n "checking for typeof... " >&6; }
11673+
if ${pgac_cv_c_typeof+:} false; then :
11674+
$as_echo_n "(cached) " >&6
11675+
else
11676+
pgac_cv_c_typeof=no
11677+
for pgac_kw in typeof __typeof__ decltype; do
11678+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11679+
/* end confdefs.h. */
11680+
11681+
int
11682+
main ()
11683+
{
11684+
int x = 0;
11685+
$pgac_kw(x) y;
11686+
y = x;
11687+
return y;
11688+
;
11689+
return 0;
11690+
}
11691+
_ACEOF
11692+
if ac_fn_c_try_compile "$LINENO"; then :
11693+
pgac_cv_c_typeof=$pgac_kw
11694+
fi
11695+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11696+
test "$pgac_cv_c_typeof" != no && break
11697+
done
11698+
fi
11699+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_typeof" >&5
11700+
$as_echo "$pgac_cv_c_typeof" >&6; }
11701+
if test "$pgac_cv_c_typeof" != no; then
11702+
11703+
$as_echo "#define HAVE_TYPEOF 1" >>confdefs.h
11704+
11705+
if test "$pgac_cv_c_typeof" != typeof; then
11706+
11707+
cat >>confdefs.h <<_ACEOF
11708+
#define typeof $pgac_cv_c_typeof
11709+
_ACEOF
11710+
11711+
fi
1167011712
fi
1167111713
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
1167211714
$as_echo_n "checking for __builtin_types_compatible_p... " >&6; }

configure.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ AC_C_FLEXIBLE_ARRAY_MEMBER
13301330
PGAC_C_SIGNED
13311331
PGAC_C_FUNCNAME_SUPPORT
13321332
PGAC_C_STATIC_ASSERT
1333+
PGAC_C_TYPEOF
13331334
PGAC_C_TYPES_COMPATIBLE
13341335
PGAC_C_BUILTIN_BSWAP32
13351336
PGAC_C_BUILTIN_BSWAP64

contrib/dblink/dblink.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -687,23 +687,25 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
687687
if (PG_NARGS() == 3)
688688
{
689689
/* text,text,bool */
690-
dblink_get_conn(text_to_cstring(PG_GETARG_TEXT_PP(0)), &conn, &conname, &freeconn);
690+
conname = text_to_cstring(PG_GETARG_TEXT_PP(0));
691691
sql = text_to_cstring(PG_GETARG_TEXT_PP(1));
692692
fail = PG_GETARG_BOOL(2);
693+
dblink_get_conn(conname, &conn, &conname, &freeconn);
693694
}
694695
else if (PG_NARGS() == 2)
695696
{
696697
/* text,text or text,bool */
697698
if (get_fn_expr_argtype(fcinfo->flinfo, 1) == BOOLOID)
698699
{
699-
conn = pconn->conn;
700700
sql = text_to_cstring(PG_GETARG_TEXT_PP(0));
701701
fail = PG_GETARG_BOOL(1);
702+
conn = pconn->conn;
702703
}
703704
else
704705
{
705-
dblink_get_conn(text_to_cstring(PG_GETARG_TEXT_PP(0)), &conn, &conname, &freeconn);
706+
conname = text_to_cstring(PG_GETARG_TEXT_PP(0));
706707
sql = text_to_cstring(PG_GETARG_TEXT_PP(1));
708+
dblink_get_conn(conname, &conn, &conname, &freeconn);
707709
}
708710
}
709711
else if (PG_NARGS() == 1)
@@ -719,16 +721,18 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
719721
else /* is_async */
720722
{
721723
/* get async result */
724+
conname = text_to_cstring(PG_GETARG_TEXT_PP(0));
725+
722726
if (PG_NARGS() == 2)
723727
{
724728
/* text,bool */
725-
conn = dblink_get_named_conn(text_to_cstring(PG_GETARG_TEXT_PP(0)));
726729
fail = PG_GETARG_BOOL(1);
730+
conn = dblink_get_named_conn(conname);
727731
}
728732
else if (PG_NARGS() == 1)
729733
{
730734
/* text */
731-
conn = dblink_get_named_conn(text_to_cstring(PG_GETARG_TEXT_PP(0)));
735+
conn = dblink_get_named_conn(conname);
732736
}
733737
else
734738
/* shouldn't happen */
@@ -1390,23 +1394,25 @@ dblink_exec(PG_FUNCTION_ARGS)
13901394
if (PG_NARGS() == 3)
13911395
{
13921396
/* must be text,text,bool */
1393-
dblink_get_conn(text_to_cstring(PG_GETARG_TEXT_PP(0)), &conn, &conname, &freeconn);
1397+
conname = text_to_cstring(PG_GETARG_TEXT_PP(0));
13941398
sql = text_to_cstring(PG_GETARG_TEXT_PP(1));
13951399
fail = PG_GETARG_BOOL(2);
1400+
dblink_get_conn(conname, &conn, &conname, &freeconn);
13961401
}
13971402
else if (PG_NARGS() == 2)
13981403
{
13991404
/* might be text,text or text,bool */
14001405
if (get_fn_expr_argtype(fcinfo->flinfo, 1) == BOOLOID)
14011406
{
1402-
conn = pconn->conn;
14031407
sql = text_to_cstring(PG_GETARG_TEXT_PP(0));
14041408
fail = PG_GETARG_BOOL(1);
1409+
conn = pconn->conn;
14051410
}
14061411
else
14071412
{
1408-
dblink_get_conn(text_to_cstring(PG_GETARG_TEXT_PP(0)), &conn, &conname, &freeconn);
1413+
conname = text_to_cstring(PG_GETARG_TEXT_PP(0));
14091414
sql = text_to_cstring(PG_GETARG_TEXT_PP(1));
1415+
dblink_get_conn(conname, &conn, &conname, &freeconn);
14101416
}
14111417
}
14121418
else if (PG_NARGS() == 1)

contrib/earthdistance/earthdistance.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,8 @@ geo_distance_internal(Point *pt1, Point *pt2)
8888
*
8989
* returns: float8
9090
* distance between the points in miles on earth's surface
91-
*
92-
* If float8 is passed-by-value, the oldstyle version-0 calling convention
93-
* is unportable, so we use version-1. However, if it's passed-by-reference,
94-
* continue to use oldstyle. This is just because we'd like earthdistance
95-
* to serve as a canary for any unintentional breakage of version-0 functions
96-
* with float8 results.
9791
******************************************************/
9892

99-
#ifdef USE_FLOAT8_BYVAL
100-
10193
PG_FUNCTION_INFO_V1(geo_distance);
10294

10395
Datum
@@ -110,17 +102,3 @@ geo_distance(PG_FUNCTION_ARGS)
110102
result = geo_distance_internal(pt1, pt2);
111103
PG_RETURN_FLOAT8(result);
112104
}
113-
#else /* !USE_FLOAT8_BYVAL */
114-
115-
double *geo_distance(Point *pt1, Point *pt2);
116-
117-
double *
118-
geo_distance(Point *pt1, Point *pt2)
119-
{
120-
double *resultp = palloc(sizeof(double));
121-
122-
*resultp = geo_distance_internal(pt1, pt2);
123-
return resultp;
124-
}
125-
126-
#endif /* USE_FLOAT8_BYVAL */

contrib/pageinspect/btreefuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ bt_page_items(PG_FUNCTION_ARGS)
363363
j = 0;
364364
values[j++] = psprintf("%d", uargs->offset);
365365
values[j++] = psprintf("(%u,%u)",
366-
BlockIdGetBlockNumber(&(itup->t_tid.ip_blkid)),
367-
itup->t_tid.ip_posid);
366+
ItemPointerGetBlockNumberNoCheck(&itup->t_tid),
367+
ItemPointerGetOffsetNumberNoCheck(&itup->t_tid));
368368
values[j++] = psprintf("%d", (int) IndexTupleSize(itup));
369369
values[j++] = psprintf("%c", IndexTupleHasNulls(itup) ? 't' : 'f');
370370
values[j++] = psprintf("%c", IndexTupleHasVarwidths(itup) ? 't' : 'f');

contrib/pageinspect/expected/hash.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ lowmask, ovflpoint, firstfree, nmaps, procid, spares, mapp FROM
4545
hash_metapage_info(get_raw_page('test_hash_a_idx', 0));
4646
-[ RECORD 1 ]----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4747
magic | 105121344
48-
version | 2
48+
version | 3
4949
ntuples | 1
5050
bsize | 8152
5151
bmsize | 4096
@@ -57,7 +57,7 @@ ovflpoint | 2
5757
firstfree | 0
5858
nmaps | 1
5959
procid | 450
60-
spares | {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
60+
spares | {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
6161
mapp | {5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
6262

6363
SELECT magic, version, ntuples, bsize, bmsize, bmshift, maxbucket, highmask,

contrib/pg_buffercache/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ MODULE_big = pg_buffercache
44
OBJS = pg_buffercache_pages.o $(WIN32RES)
55

66
EXTENSION = pg_buffercache
7-
DATA = pg_buffercache--1.2.sql pg_buffercache--1.1--1.2.sql \
8-
pg_buffercache--1.0--1.1.sql pg_buffercache--unpackaged--1.0.sql
7+
DATA = pg_buffercache--1.2.sql pg_buffercache--1.2--1.3.sql \
8+
pg_buffercache--1.1--1.2.sql pg_buffercache--1.0--1.1.sql \
9+
pg_buffercache--unpackaged--1.0.sql
910
PGFILEDESC = "pg_buffercache - monitoring of shared buffer cache in real-time"
1011

1112
ifdef USE_PGXS
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* contrib/pg_buffercache/pg_buffercache--1.2--1.3.sql */
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use "ALTER EXTENSION pg_buffercache UPDATE TO '1.3'" to load this file. \quit
5+
6+
GRANT EXECUTE ON FUNCTION pg_buffercache_pages() TO pg_monitor;
7+
GRANT SELECT ON pg_buffercache TO pg_monitor;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pg_buffercache extension
22
comment = 'examine the shared buffer cache'
3-
default_version = '1.2'
3+
default_version = '1.3'
44
module_pathname = '$libdir/pg_buffercache'
55
relocatable = true

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