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

Commit0326640

Browse files
author
Aleksandr Parfenov
committed
Merge branch 'master' into pgpro-1103-flexible-fts
2 parentsed6d8ff +6946280 commit0326640

File tree

521 files changed

+30136
-11008
lines changed

Some content is hidden

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

521 files changed

+30136
-11008
lines changed

‎configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ with_uuid
708708
with_systemd
709709
with_selinux
710710
with_openssl
711+
with_ldap
711712
krb_srvtab
712713
with_python
713714
with_perl
@@ -5925,6 +5926,7 @@ fi
59255926
$as_echo"$with_ldap">&6; }
59265927

59275928

5929+
59285930
#
59295931
# Bonjour
59305932
#

‎configure.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ PGAC_ARG_BOOL(with, ldap, no,
682682
[build with LDAP support],
683683
[AC_DEFINE([USE_LDAP], 1, [Define to 1 to build with LDAP support. (--with-ldap)])])
684684
AC_MSG_RESULT([$with_ldap])
685+
AC_SUBST(with_ldap)
685686

686687

687688
#

‎contrib/auto_explain/auto_explain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ _PG_init(void)
7878
"Zero prints all plans. -1 turns this feature off.",
7979
&auto_explain_log_min_duration,
8080
-1,
81-
-1,INT_MAX /1000,
81+
-1,INT_MAX,
8282
PGC_SUSET,
8383
GUC_UNIT_MS,
8484
NULL,

‎contrib/bloom/blinsert.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ blbuild(Relation heap, Relation index, IndexInfo *indexInfo)
135135

136136
/* Do the heap scan */
137137
reltuples=IndexBuildHeapScan(heap,index,indexInfo, true,
138-
bloomBuildCallback, (void*)&buildstate);
138+
bloomBuildCallback, (void*)&buildstate,
139+
NULL);
139140

140141
/*
141142
* There are could be some items in cached page. Flush this page if

‎contrib/btree_gist/btree_inet.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ gbt_inet_compress(PG_FUNCTION_ARGS)
9999
if (entry->leafkey)
100100
{
101101
inetKEY*r= (inetKEY*)palloc(sizeof(inetKEY));
102+
boolfailure= false;
102103

103104
retval=palloc(sizeof(GISTENTRY));
104-
r->lower=convert_network_to_scalar(entry->key,INETOID);
105+
r->lower=convert_network_to_scalar(entry->key,INETOID,&failure);
106+
Assert(!failure);
105107
r->upper=r->lower;
106108
gistentryinit(*retval,PointerGetDatum(r),
107109
entry->rel,entry->page,
@@ -118,13 +120,18 @@ Datum
118120
gbt_inet_consistent(PG_FUNCTION_ARGS)
119121
{
120122
GISTENTRY*entry= (GISTENTRY*)PG_GETARG_POINTER(0);
121-
doublequery=convert_network_to_scalar(PG_GETARG_DATUM(1),INETOID);
123+
Datumdquery=PG_GETARG_DATUM(1);
122124
StrategyNumberstrategy= (StrategyNumber)PG_GETARG_UINT16(2);
123125

124126
/* Oidsubtype = PG_GETARG_OID(3); */
125127
bool*recheck= (bool*)PG_GETARG_POINTER(4);
126128
inetKEY*kkk= (inetKEY*)DatumGetPointer(entry->key);
127129
GBT_NUMKEY_Rkey;
130+
doublequery;
131+
boolfailure= false;
132+
133+
query=convert_network_to_scalar(dquery,INETOID,&failure);
134+
Assert(!failure);
128135

129136
/* All cases served by this function are inexact */
130137
*recheck= true;

‎contrib/btree_gist/expected/inet.out

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,42 @@ SELECT count(*) FROM inettmp WHERE a > '89.225.196.191'::inet;
6464
386
6565
(1 row)
6666

67+
VACUUM inettmp;
68+
-- gist_inet_ops lacks a fetch function, so this should not be index-only scan
69+
EXPLAIN (COSTS OFF)
70+
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
71+
QUERY PLAN
72+
--------------------------------------------------------
73+
Aggregate
74+
-> Bitmap Heap Scan on inettmp
75+
Recheck Cond: (a = '89.225.196.191'::inet)
76+
-> Bitmap Index Scan on inetidx
77+
Index Cond: (a = '89.225.196.191'::inet)
78+
(5 rows)
79+
80+
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
81+
count
82+
-------
83+
1
84+
(1 row)
85+
86+
DROP INDEX inetidx;
87+
CREATE INDEX ON inettmp USING gist (a gist_inet_ops, a inet_ops);
88+
-- likewise here (checks for core planner bug)
89+
EXPLAIN (COSTS OFF)
90+
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
91+
QUERY PLAN
92+
--------------------------------------------------------
93+
Aggregate
94+
-> Bitmap Heap Scan on inettmp
95+
Recheck Cond: (a = '89.225.196.191'::inet)
96+
-> Bitmap Index Scan on inettmp_a_a1_idx
97+
Index Cond: (a = '89.225.196.191'::inet)
98+
(5 rows)
99+
100+
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
101+
count
102+
-------
103+
1
104+
(1 row)
105+

‎contrib/btree_gist/sql/inet.sql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,21 @@ SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
2929
SELECTcount(*)FROM inettmpWHERE a>='89.225.196.191'::inet;
3030

3131
SELECTcount(*)FROM inettmpWHERE a>'89.225.196.191'::inet;
32+
33+
VACUUM inettmp;
34+
35+
-- gist_inet_ops lacks a fetch function, so this should not be index-only scan
36+
EXPLAIN (COSTS OFF)
37+
SELECTcount(*)FROM inettmpWHERE a='89.225.196.191'::inet;
38+
39+
SELECTcount(*)FROM inettmpWHERE a='89.225.196.191'::inet;
40+
41+
DROPINDEX inetidx;
42+
43+
CREATEINDEXON inettmp USING gist (a gist_inet_ops, a inet_ops);
44+
45+
-- likewise here (checks for core planner bug)
46+
EXPLAIN (COSTS OFF)
47+
SELECTcount(*)FROM inettmpWHERE a='89.225.196.191'::inet;
48+
49+
SELECTcount(*)FROM inettmpWHERE a='89.225.196.191'::inet;

‎contrib/oid2name/oid2name.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include"catalog/pg_class.h"
1313

14+
#include"fe_utils/connect.h"
1415
#include"libpq-fe.h"
1516
#include"pg_getopt.h"
1617

@@ -266,6 +267,7 @@ sql_conn(struct options *my_opts)
266267
boolhave_password= false;
267268
charpassword[100];
268269
boolnew_pass;
270+
PGresult*res;
269271

270272
/*
271273
* Start the connection. Loop until we have a password if requested by
@@ -323,6 +325,17 @@ sql_conn(struct options *my_opts)
323325
exit(1);
324326
}
325327

328+
res=PQexec(conn,ALWAYS_SECURE_SEARCH_PATH_SQL);
329+
if (PQresultStatus(res)!=PGRES_TUPLES_OK)
330+
{
331+
fprintf(stderr,"oid2name: could not clear search_path: %s\n",
332+
PQerrorMessage(conn));
333+
PQclear(res);
334+
PQfinish(conn);
335+
exit(-1);
336+
}
337+
PQclear(res);
338+
326339
/* return the conn if good */
327340
returnconn;
328341
}

‎contrib/pgcrypto/pgp-armor.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static const unsigned char _base64[] =
4242
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
4343

4444
staticint
45-
b64_encode(constuint8*src,unsignedlen,uint8*dst)
45+
pg_base64_encode(constuint8*src,unsignedlen,uint8*dst)
4646
{
4747
uint8*p,
4848
*lend=dst+76;
@@ -92,7 +92,7 @@ b64_encode(const uint8 *src, unsigned len, uint8 *dst)
9292

9393
/* probably should use lookup table */
9494
staticint
95-
b64_decode(constuint8*src,unsignedlen,uint8*dst)
95+
pg_base64_decode(constuint8*src,unsignedlen,uint8*dst)
9696
{
9797
constuint8*srcend=src+len,
9898
*s=src;
@@ -160,7 +160,7 @@ b64_decode(const uint8 *src, unsigned len, uint8 *dst)
160160
}
161161

162162
staticunsigned
163-
b64_enc_len(unsignedsrclen)
163+
pg_base64_enc_len(unsignedsrclen)
164164
{
165165
/*
166166
* 3 bytes will be converted to 4, linefeed after 76 chars
@@ -169,7 +169,7 @@ b64_enc_len(unsigned srclen)
169169
}
170170

171171
staticunsigned
172-
b64_dec_len(unsignedsrclen)
172+
pg_base64_dec_len(unsignedsrclen)
173173
{
174174
return (srclen*3) >>2;
175175
}
@@ -218,11 +218,11 @@ pgp_armor_encode(const uint8 *src, unsigned len, StringInfo dst,
218218
appendStringInfo(dst,"%s: %s\n",keys[n],values[n]);
219219
appendStringInfoChar(dst,'\n');
220220

221-
/* make sure we have enough room tob64_encode() */
222-
b64len=b64_enc_len(len);
221+
/* make sure we have enough room topg_base64_encode() */
222+
b64len=pg_base64_enc_len(len);
223223
enlargeStringInfo(dst, (int)b64len);
224224

225-
res=b64_encode(src,len, (uint8*)dst->data+dst->len);
225+
res=pg_base64_encode(src,len, (uint8*)dst->data+dst->len);
226226
if (res>b64len)
227227
elog(FATAL,"overflow - encode estimate too small");
228228
dst->len+=res;
@@ -358,14 +358,14 @@ pgp_armor_decode(const uint8 *src, int len, StringInfo dst)
358358
gotoout;
359359

360360
/* decode crc */
361-
if (b64_decode(p+1,4,buf)!=3)
361+
if (pg_base64_decode(p+1,4,buf)!=3)
362362
gotoout;
363363
crc= (((long)buf[0]) <<16)+ (((long)buf[1]) <<8)+ (long)buf[2];
364364

365365
/* decode data */
366-
blen= (int)b64_dec_len(len);
366+
blen= (int)pg_base64_dec_len(len);
367367
enlargeStringInfo(dst,blen);
368-
res=b64_decode(base64_start,base64_end-base64_start, (uint8*)dst->data);
368+
res=pg_base64_decode(base64_start,base64_end-base64_start, (uint8*)dst->data);
369369
if (res>blen)
370370
elog(FATAL,"overflow - decode estimate too small");
371371
if (res >=0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp