Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a6d29d3

Browse files
committed
Merge branch 'PGPROEE10' into PGPROEE10_libpq
2 parents 822d7b8 + fa58d72 commit a6d29d3

File tree

306 files changed

+7782
-15215
lines changed

Some content is hidden

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

306 files changed

+7782
-15215
lines changed

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,11 +1984,11 @@ if test x"$USE_SSE42_CRC32C" = x"1"; then
19841984
AC_MSG_RESULT(SSE 4.2)
19851985
else
19861986
if test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then
1987-
AC_DEFINE(USE_SSE42_CRC32C_WITH_RUNTIME_CHECK, 1, [Define to 1 to use Intel SSSE 4.2 CRC instructions with a runtime check.])
1987+
AC_DEFINE(USE_SSE42_CRC32C_WITH_RUNTIME_CHECK, 1, [Define to 1 to use Intel SSE 4.2 CRC instructions with a runtime check.])
19881988
PG_CRC32C_OBJS="pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_choose.o"
19891989
AC_MSG_RESULT(SSE 4.2 with runtime check)
19901990
else
1991-
AC_DEFINE(USE_SLICING_BY_8_CRC32C, 1, [Define to 1 to use Intel SSE 4.2 CRC instructions with a runtime check.])
1991+
AC_DEFINE(USE_SLICING_BY_8_CRC32C, 1, [Define to 1 to use software CRC-32C implementation (slicing-by-8).])
19921992
PG_CRC32C_OBJS="pg_crc32c_sb8.o"
19931993
AC_MSG_RESULT(slicing-by-8)
19941994
fi

contrib/adminpack/adminpack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pg_file_rename(PG_FUNCTION_ARGS)
173173
fn1 = convert_and_check_filename(PG_GETARG_TEXT_PP(0), false);
174174
fn2 = convert_and_check_filename(PG_GETARG_TEXT_PP(1), false);
175175
if (PG_ARGISNULL(2))
176-
fn3 = 0;
176+
fn3 = NULL;
177177
else
178178
fn3 = convert_and_check_filename(PG_GETARG_TEXT_PP(2), false);
179179

@@ -195,7 +195,7 @@ pg_file_rename(PG_FUNCTION_ARGS)
195195
PG_RETURN_BOOL(false);
196196
}
197197

198-
rc = access(fn3 ? fn3 : fn2, 2);
198+
rc = access(fn3 ? fn3 : fn2, W_OK);
199199
if (rc >= 0 || errno != ENOENT)
200200
{
201201
ereport(ERROR,

contrib/bloom/blinsert.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ PG_MODULE_MAGIC;
3333
typedef struct
3434
{
3535
BloomState blstate; /* bloom index state */
36+
int64 indtuples; /* total number of tuples indexed */
3637
MemoryContext tmpCtx; /* temporary memory context reset after each
3738
* tuple */
3839
char data[BLCKSZ]; /* cached page */
39-
int64 count; /* number of tuples in cached page */
40+
int count; /* number of tuples in cached page */
4041
} BloomBuildState;
4142

4243
/*
@@ -102,8 +103,14 @@ bloomBuildCallback(Relation index, HeapTuple htup, Datum *values,
102103
/* We shouldn't be here since we're inserting to the empty page */
103104
elog(ERROR, "could not add new bloom tuple to empty page");
104105
}
106+
107+
/* Next item was added successfully */
108+
buildstate->count++;
105109
}
106110

111+
/* Update total tuple count */
112+
buildstate->indtuples += 1;
113+
107114
MemoryContextSwitchTo(oldCtx);
108115
MemoryContextReset(buildstate->tmpCtx);
109116
}
@@ -137,17 +144,15 @@ blbuild(Relation heap, Relation index, IndexInfo *indexInfo)
137144
reltuples = IndexBuildHeapScan(heap, index, indexInfo, true,
138145
bloomBuildCallback, (void *) &buildstate);
139146

140-
/*
141-
* There are could be some items in cached page. Flush this page if
142-
* needed.
143-
*/
147+
/* Flush last page if needed (it will be, unless heap was empty) */
144148
if (buildstate.count > 0)
145149
flushCachedPage(index, &buildstate);
146150

147151
MemoryContextDelete(buildstate.tmpCtx);
148152

149153
result = (IndexBuildResult *) palloc(sizeof(IndexBuildResult));
150-
result->heap_tuples = result->index_tuples = reltuples;
154+
result->heap_tuples = reltuples;
155+
result->index_tuples = buildstate.indtuples;
151156

152157
return result;
153158
}

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+
bool failure = 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-
double query = convert_network_to_scalar(PG_GETARG_DATUM(1), INETOID);
123+
Datum dquery = PG_GETARG_DATUM(1);
122124
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
123125

124126
/* Oid subtype = PG_GETARG_OID(3); */
125127
bool *recheck = (bool *) PG_GETARG_POINTER(4);
126128
inetKEY *kkk = (inetKEY *) DatumGetPointer(entry->key);
127129
GBT_NUMKEY_R key;
130+
double query;
131+
bool failure = 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
SELECT count(*) FROM inettmp WHERE a >= '89.225.196.191'::inet;
3030

3131
SELECT count(*) FROM inettmp WHERE 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+
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
38+
39+
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
40+
41+
DROP INDEX inetidx;
42+
43+
CREATE INDEX ON inettmp USING gist (a gist_inet_ops, a inet_ops);
44+
45+
-- likewise here (checks for core planner bug)
46+
EXPLAIN (COSTS OFF)
47+
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
48+
49+
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;

contrib/cube/cube.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,6 @@ cube_coord_llur(PG_FUNCTION_ARGS)
15551555
{
15561556
NDBOX *cube = PG_GETARG_NDBOX(0);
15571557
int coord = PG_GETARG_INT32(1);
1558-
bool inverse = false;
15591558
float8 result;
15601559

15611560
/* 0 is the only unsupported coordinate value */
@@ -1593,10 +1592,6 @@ cube_coord_llur(PG_FUNCTION_ARGS)
15931592
result = 0.0;
15941593
}
15951594

1596-
/* Inverse value if needed */
1597-
if (inverse)
1598-
result = -result;
1599-
16001595
PG_RETURN_FLOAT8(result);
16011596
}
16021597

contrib/in_memory/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ submake-isolation:
4141
submake-in_memory:
4242
$(MAKE) -C $(top_builddir)/contrib/in_memory
4343

44-
REGRESSCHECKS = in_memory tuple_limit subtrans ddl_forbid non_coercible
44+
REGRESSCHECKS = in_memory tuple_limit subtrans ddl_forbid non_coercible collation
4545

4646
regresscheck: | submake-regress submake-in_memory temp-install
4747
$(pg_regress_check) \
@@ -60,5 +60,5 @@ isolationcheck: | submake-isolation submake-in_memory temp-install
6060

6161
temp-install: EXTRA_INSTALL=contrib/in_memory
6262

63-
standby-check: submake-in_memory temp-install
63+
prove-check: submake-in_memory temp-install
6464
$(prove_check)

0 commit comments

Comments
 (0)