Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaa84428

Browse files
author
Alexander Korotkov
committed
Merge branch 'PGPROEE9_6' into PGPROEE9_6-9-idle-timeout
2 parents4b5cfd7 +7a7527c commitaa84428

File tree

702 files changed

+533183
-16374
lines changed

Some content is hidden

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

702 files changed

+533183
-16374
lines changed

‎configure

Lines changed: 2098 additions & 173 deletions
Large diffs are not rendered by default.

‎configure.in

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

20-
AC_INIT([PostgreSQL], [9.6.beta.3], [pgsql-bugs@postgresql.org])
20+
AC_INIT([PostgreSQL], [9.6rc1], [bugs@postgrespro.ru],[postgrespro])
21+
PACKAGE_TARNAME=postgrespro
2122

2223
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
2324
Untested combinations of 'autoconf' and PostgreSQL versions are not
2425
recommended. You can remove the check from 'configure.in' but it is then
2526
your responsibility whether the result works or not.])])
26-
AC_COPYRIGHT([Copyright (c) 1996-2016, PostgreSQL Global Development Group])
27+
AC_COPYRIGHT([Copyright (c) 1996-2016, PostgreSQL Global Development Group
28+
Copyright (c) 2015-2016, Postgres Professional])
2729
AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
2830
AC_CONFIG_AUX_DIR(config)
2931
AC_PREFIX_DEFAULT(/usr/local/pgsql)
@@ -36,7 +38,12 @@ AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major versio
3638
PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version],
3739
[PG_VERSION="$PACKAGE_VERSION$withval"],
3840
[PG_VERSION="$PACKAGE_VERSION"])
41+
PGPRO_VERSION="$PACKAGE_VERSION.1"
42+
PGPRO_PACKAGE_NAME="PostgresPro"
43+
AC_SUBST(PGPRO_PACKAGE_NAME)
3944
AC_DEFINE_UNQUOTED(PG_VERSION, "$PG_VERSION", [PostgreSQL version as a string])
45+
AC_DEFINE_UNQUOTED(PGPRO_PACKAGE_NAME, "$PGPRO_PACKAGE_NAME", [PostgresPro name as a string])
46+
AC_DEFINE_UNQUOTED(PGPRO_VERSION, "$PGPRO_VERSION", [PostgresPro version as a string])
4047

4148
AC_CANONICAL_HOST
4249

@@ -729,6 +736,16 @@ PGAC_ARG_BOOL(with, systemd, no, [build with systemd support],
729736
AC_SUBST(with_systemd)
730737
AC_MSG_RESULT([$with_systemd])
731738

739+
#
740+
# ICU
741+
#
742+
AC_MSG_CHECKING([whether to build with ICU support])
743+
PGAC_ARG_BOOL(with, icu, no, [ --with-icu build with ICU support],
744+
[AC_DEFINE([USE_ICU], 1, [Define to build with ICU support. (--with-icu)])])
745+
AC_MSG_RESULT([$with_icu])
746+
AC_SUBST(with_icu)
747+
748+
732749
#
733750
# Readline
734751
#
@@ -1112,12 +1129,91 @@ if test "$with_openssl" = yes ; then
11121129
dnl Order matters!
11131130
if test "$PORTNAME" != "win32"; then
11141131
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
1115-
AC_CHECK_LIB(ssl,SSL_library_init, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
1132+
AC_CHECK_LIB(ssl,SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
11161133
else
11171134
AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
1118-
AC_SEARCH_LIBS(SSL_library_init, ssleay32 ssl, [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
1135+
AC_SEARCH_LIBS(SSL_new, ssleay32 ssl, [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
11191136
fi
11201137
AC_CHECK_FUNCS([SSL_get_current_compression])
1138+
# Functions introduced in OpenSSL 1.1.0. We used to check for
1139+
# OPENSSL_VERSION_NUMBER, but that didn't work with 1.1.0, because LibreSSL
1140+
# defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it
1141+
# doesn't have these OpenSSL 1.1.0 functions. So check for individual
1142+
# functions.
1143+
AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data RAND_OpenSSL])
1144+
# OpenSSL versions before 1.1.0 required setting callback functions, for
1145+
# thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock()
1146+
# function was removed.
1147+
AC_CHECK_FUNCS([CRYPTO_lock])
1148+
fi
1149+
1150+
if test "$with_icu" = yes ; then
1151+
AC_SEARCH_LIBS(ucol_open_57, [icui18n icuin], [], [
1152+
AC_SEARCH_LIBS(ucol_open_56, [icui18n icuin], [], [
1153+
AC_SEARCH_LIBS(ucol_open_55, [icui18n icuin], [], [
1154+
AC_SEARCH_LIBS(ucol_open_54, [icui18n icuin], [], [
1155+
AC_SEARCH_LIBS(ucol_open_53, [icui18n icuin], [], [
1156+
AC_SEARCH_LIBS(ucol_open_52, [icui18n icuin], [], [
1157+
AC_SEARCH_LIBS(ucol_open_50, [icui18n icuin], [], [
1158+
AC_SEARCH_LIBS(ucol_open_48, [icui18n icuin], [], [
1159+
AC_SEARCH_LIBS(ucol_open_46, [icui18n icuin], [], [
1160+
AC_SEARCH_LIBS(ucol_open_44, [icui18n icuin], [], [
1161+
AC_SEARCH_LIBS(ucol_open_43, [icui18n icuin], [], [
1162+
AC_SEARCH_LIBS(ucol_open_4_2, [icui18n icuin], [], [
1163+
AC_SEARCH_LIBS(ucol_open_4_1, [icui18n icuin], [], [
1164+
AC_SEARCH_LIBS(ucol_open_4_0, [icui18n icuin], [], [
1165+
AC_SEARCH_LIBS(ucol_open_3_8, [icui18n icuin], [], [
1166+
AC_SEARCH_LIBS(ucol_open_3_6, [icui18n icuin], [], [
1167+
AC_SEARCH_LIBS(ucol_open_3_4, [icui18n icuin], [], [AC_MSG_ERROR([library 'icui18n' is required for ICU])])
1168+
])
1169+
])
1170+
])
1171+
])
1172+
])
1173+
])
1174+
])
1175+
])
1176+
])
1177+
])
1178+
])
1179+
])
1180+
])
1181+
])
1182+
])
1183+
])
1184+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_57, [], [
1185+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_56, [], [
1186+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_55, [], [
1187+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_54, [], [
1188+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_53, [], [
1189+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_52, [], [
1190+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_50, [], [
1191+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_48, [], [
1192+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_46, [], [
1193+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_44, [], [
1194+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_43, [], [
1195+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_4_2, [], [
1196+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_4_1, [], [
1197+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_4_0, [], [
1198+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_3_8, [], [
1199+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_3_6, [], [
1200+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_3_4, [], [AC_MSG_ERROR([library 'icuuc' is required for ICU])])
1201+
])
1202+
])
1203+
])
1204+
])
1205+
])
1206+
])
1207+
])
1208+
])
1209+
])
1210+
])
1211+
])
1212+
])
1213+
])
1214+
])
1215+
])
1216+
])
11211217
fi
11221218

11231219
if test "$with_pam" = yes ; then
@@ -1273,6 +1369,10 @@ if test "$with_openssl" = yes ; then
12731369
AC_CHECK_HEADER(openssl/err.h, [], [AC_MSG_ERROR([header file <openssl/err.h> is required for OpenSSL])])
12741370
fi
12751371

1372+
if test "$with_icu" = yes ; then
1373+
AC_CHECK_HEADER(unicode/utypes.h, [], [AC_MSG_ERROR([header file <unicode/utypes.h> is required for ICU])])
1374+
fi
1375+
12761376
if test "$with_pam" = yes ; then
12771377
AC_CHECK_HEADERS(security/pam_appl.h, [],
12781378
[AC_CHECK_HEADERS(pam/pam_appl.h, [],
@@ -2144,6 +2244,9 @@ AC_DEFINE_UNQUOTED(PG_VERSION_STR,
21442244
["PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
21452245
[A string containing the version number, platform, and C compiler])
21462246

2247+
AC_DEFINE_UNQUOTED(PGPRO_VERSION_STR,
2248+
["PostgresPro $PGPRO_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
2249+
[A string containing the version number, platform, and C compiler])
21472250
# Supply a numeric version string for use by 3rd party add-ons
21482251
# awk -F is a regex on some platforms, and not on others, so make "." a tab
21492252
[PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
@@ -2178,6 +2281,7 @@ else
21782281
fi
21792282
AC_SUBST(vpath_build)
21802283

2284+
AC_SUBST(PGPRO_VERSION)
21812285

21822286
AC_CONFIG_FILES([GNUmakefile src/Makefile.global])
21832287

‎contrib/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ SUBDIRS = \
4949
tsm_system_time\
5050
tsearch2\
5151
unaccent\
52-
vacuumlo
52+
vacuumlo\
53+
dump_stat\
54+
hunspell_en_us\
55+
hunspell_fr\
56+
hunspell_nl_nl\
57+
hunspell_ru_ru\
58+
pg_variables\
59+
jsquery\
60+
sr_plan\
61+
shared_ispell
5362

5463
ifeq ($(with_openssl),yes)
5564
SUBDIRS += sslinfo

‎contrib/bloom/blinsert.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ blbuild(Relation heap, Relation index, IndexInfo *indexInfo)
130130
initBloomState(&buildstate.blstate,index);
131131
buildstate.tmpCtx=AllocSetContextCreate(CurrentMemoryContext,
132132
"Bloom build temporary context",
133-
ALLOCSET_DEFAULT_MINSIZE,
134-
ALLOCSET_DEFAULT_INITSIZE,
135-
ALLOCSET_DEFAULT_MAXSIZE);
133+
ALLOCSET_DEFAULT_SIZES);
136134
initCachedPage(&buildstate);
137135

138136
/* Do the heap scan */
@@ -204,9 +202,7 @@ blinsert(Relation index, Datum *values, bool *isnull,
204202

205203
insertCtx=AllocSetContextCreate(CurrentMemoryContext,
206204
"Bloom insert temporary context",
207-
ALLOCSET_DEFAULT_MINSIZE,
208-
ALLOCSET_DEFAULT_INITSIZE,
209-
ALLOCSET_DEFAULT_MAXSIZE);
205+
ALLOCSET_DEFAULT_SIZES);
210206

211207
oldCtx=MemoryContextSwitchTo(insertCtx);
212208

@@ -237,6 +233,13 @@ blinsert(Relation index, Datum *values, bool *isnull,
237233
state=GenericXLogStart(index);
238234
page=GenericXLogRegisterBuffer(state,buffer,0);
239235

236+
/*
237+
* We might have found a page that was recently deleted by VACUUM. If
238+
* so, we can reuse it, but we must reinitialize it.
239+
*/
240+
if (PageIsNew(page)||BloomPageIsDeleted(page))
241+
BloomInitPage(page,0);
242+
240243
if (BloomPageAddItem(&blstate,page,itup))
241244
{
242245
/* Success! Apply the change, clean up, and exit */
@@ -295,6 +298,10 @@ blinsert(Relation index, Datum *values, bool *isnull,
295298
LockBuffer(buffer,BUFFER_LOCK_EXCLUSIVE);
296299
page=GenericXLogRegisterBuffer(state,buffer,0);
297300

301+
/* Basically same logic as above */
302+
if (PageIsNew(page)||BloomPageIsDeleted(page))
303+
BloomInitPage(page,0);
304+
298305
if (BloomPageAddItem(&blstate,page,itup))
299306
{
300307
/* Success! Apply the changes, clean up, and exit */

‎contrib/bloom/blscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
135135
page=BufferGetPage(buffer);
136136
TestForOldSnapshot(scan->xs_snapshot,scan->indexRelation,page);
137137

138-
if (!BloomPageIsDeleted(page))
138+
if (!PageIsNew(page)&& !BloomPageIsDeleted(page))
139139
{
140140
OffsetNumberoffset,
141141
maxOffset=BloomPageGetMaxOffset(page);

‎contrib/bloom/blutils.c

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,24 +119,25 @@ blhandler(PG_FUNCTION_ARGS)
119119
amroutine->amstorage= false;
120120
amroutine->amclusterable= false;
121121
amroutine->ampredlocks= false;
122-
amroutine->amkeytype=0;
122+
amroutine->amkeytype=InvalidOid;
123123

124-
amroutine->aminsert=blinsert;
125-
amroutine->ambeginscan=blbeginscan;
126-
amroutine->amgettuple=NULL;
127-
amroutine->amgetbitmap=blgetbitmap;
128-
amroutine->amrescan=blrescan;
129-
amroutine->amendscan=blendscan;
130-
amroutine->ammarkpos=NULL;
131-
amroutine->amrestrpos=NULL;
132124
amroutine->ambuild=blbuild;
133125
amroutine->ambuildempty=blbuildempty;
126+
amroutine->aminsert=blinsert;
134127
amroutine->ambulkdelete=blbulkdelete;
135128
amroutine->amvacuumcleanup=blvacuumcleanup;
136129
amroutine->amcanreturn=NULL;
137130
amroutine->amcostestimate=blcostestimate;
138131
amroutine->amoptions=bloptions;
132+
amroutine->amproperty=NULL;
139133
amroutine->amvalidate=blvalidate;
134+
amroutine->ambeginscan=blbeginscan;
135+
amroutine->amrescan=blrescan;
136+
amroutine->amgettuple=NULL;
137+
amroutine->amgetbitmap=blgetbitmap;
138+
amroutine->amendscan=blendscan;
139+
amroutine->ammarkpos=NULL;
140+
amroutine->amrestrpos=NULL;
140141

141142
PG_RETURN_POINTER(amroutine);
142143
}
@@ -298,7 +299,7 @@ BloomFormTuple(BloomState *state, ItemPointer iptr, Datum *values, bool *isnull)
298299

299300
/*
300301
* Add new bloom tuple to the page. Returns true if new tuple was successfully
301-
* added to the page. Returns false if it doesn't fit the page.
302+
* added to the page. Returns false if it doesn't fitonthe page.
302303
*/
303304
bool
304305
BloomPageAddItem(BloomState*state,Pagepage,BloomTuple*tuple)
@@ -307,7 +308,10 @@ BloomPageAddItem(BloomState *state, Page page, BloomTuple *tuple)
307308
BloomPageOpaqueopaque;
308309
Pointerptr;
309310

310-
/* Does new tuple fit the page */
311+
/* We shouldn't be pointed to an invalid page */
312+
Assert(!PageIsNew(page)&& !BloomPageIsDeleted(page));
313+
314+
/* Does new tuple fit on the page? */
311315
if (BloomPageGetFreeSpace(state,page)<state->sizeOfBloomTuple)
312316
return false;
313317

@@ -321,6 +325,9 @@ BloomPageAddItem(BloomState *state, Page page, BloomTuple *tuple)
321325
ptr= (Pointer)BloomPageGetTuple(state,page,opaque->maxoff+1);
322326
((PageHeader)page)->pd_lower=ptr-page;
323327

328+
/* Assert we didn't overrun available space */
329+
Assert(((PageHeader)page)->pd_lower <= ((PageHeader)page)->pd_upper);
330+
324331
return true;
325332
}
326333

@@ -423,6 +430,9 @@ BloomFillMetapage(Relation index, Page metaPage)
423430
metadata->magickNumber=BLOOM_MAGICK_NUMBER;
424431
metadata->opts=*opts;
425432
((PageHeader)metaPage)->pd_lower+=sizeof(BloomMetaPageData);
433+
434+
/* If this fails, probably FreeBlockNumberArray size calc is wrong: */
435+
Assert(((PageHeader)metaPage)->pd_lower <= ((PageHeader)metaPage)->pd_upper);
426436
}
427437

428438
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp