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

Commit ff3879d

Browse files
committed
Merge branch 'master' into autoprepare_extended
2 parents dc7dbe4 + ffa2d37 commit ff3879d

File tree

139 files changed

+2248
-687
lines changed

Some content is hidden

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

139 files changed

+2248
-687
lines changed

contrib/jsonb_plperl/expected/jsonb_plperl.out

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@ SELECT testRegexpResultToJsonb();
6666
0
6767
(1 row)
6868

69+
-- this revealed a different bug
70+
CREATE FUNCTION testTextToJsonbObject(text) RETURNS jsonb
71+
LANGUAGE plperl
72+
TRANSFORM FOR TYPE jsonb
73+
AS $$
74+
my $x = shift;
75+
return {a => $x};
76+
$$;
77+
SELECT testTextToJsonbObject('abc');
78+
testtexttojsonbobject
79+
-----------------------
80+
{"a": "abc"}
81+
(1 row)
82+
83+
SELECT testTextToJsonbObject(NULL);
84+
testtexttojsonbobject
85+
-----------------------
86+
{"a": null}
87+
(1 row)
88+
6989
CREATE FUNCTION roundtrip(val jsonb, ref text = '') RETURNS jsonb
7090
LANGUAGE plperl
7191
TRANSFORM FOR TYPE jsonb
@@ -230,4 +250,4 @@ SELECT roundtrip('{"1": {"2": [3, 4, 5]}, "2": 3}', 'HASH');
230250

231251
\set VERBOSITY terse \\ -- suppress cascade details
232252
DROP EXTENSION plperl CASCADE;
233-
NOTICE: drop cascades to 7 other objects
253+
NOTICE: drop cascades to 8 other objects

contrib/jsonb_plperl/expected/jsonb_plperlu.out

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@ SELECT testRegexpResultToJsonb();
6666
0
6767
(1 row)
6868

69+
-- this revealed a different bug
70+
CREATE FUNCTION testTextToJsonbObject(text) RETURNS jsonb
71+
LANGUAGE plperlu
72+
TRANSFORM FOR TYPE jsonb
73+
AS $$
74+
my $x = shift;
75+
return {a => $x};
76+
$$;
77+
SELECT testTextToJsonbObject('abc');
78+
testtexttojsonbobject
79+
-----------------------
80+
{"a": "abc"}
81+
(1 row)
82+
83+
SELECT testTextToJsonbObject(NULL);
84+
testtexttojsonbobject
85+
-----------------------
86+
{"a": null}
87+
(1 row)
88+
6989
CREATE FUNCTION roundtrip(val jsonb, ref text = '') RETURNS jsonb
7090
LANGUAGE plperlu
7191
TRANSFORM FOR TYPE jsonb
@@ -257,4 +277,4 @@ INFO: $VAR1 = {'1' => {'2' => ['3','4','5']},'2' => '3'};
257277

258278
\set VERBOSITY terse \\ -- suppress cascade details
259279
DROP EXTENSION plperlu CASCADE;
260-
NOTICE: drop cascades to 7 other objects
280+
NOTICE: drop cascades to 8 other objects

contrib/jsonb_plperl/jsonb_plperl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem)
189189
case SVt_PVHV:
190190
return HV_to_JsonbValue((HV *) in, jsonb_state);
191191

192-
case SVt_NULL:
193-
out.type = jbvNull;
194-
break;
195-
196192
default:
197-
if (SvUOK(in))
193+
if (!SvOK(in))
194+
{
195+
out.type = jbvNull;
196+
}
197+
else if (SvUOK(in))
198198
{
199199
/*
200200
* If UV is >=64 bits, we have no better way to make this

contrib/jsonb_plperl/sql/jsonb_plperl.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ $$;
5757
SELECT testRegexpResultToJsonb();
5858

5959

60+
-- this revealed a different bug
61+
CREATE FUNCTION testTextToJsonbObject(text) RETURNS jsonb
62+
LANGUAGE plperl
63+
TRANSFORM FOR TYPE jsonb
64+
AS $$
65+
my $x = shift;
66+
return {a => $x};
67+
$$;
68+
69+
SELECT testTextToJsonbObject('abc');
70+
SELECT testTextToJsonbObject(NULL);
71+
72+
6073
CREATE FUNCTION roundtrip(val jsonb, ref text = '') RETURNS jsonb
6174
LANGUAGE plperl
6275
TRANSFORM FOR TYPE jsonb

contrib/jsonb_plperl/sql/jsonb_plperlu.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ $$;
5757
SELECT testRegexpResultToJsonb();
5858

5959

60+
-- this revealed a different bug
61+
CREATE FUNCTION testTextToJsonbObject(text) RETURNS jsonb
62+
LANGUAGE plperlu
63+
TRANSFORM FOR TYPE jsonb
64+
AS $$
65+
my $x = shift;
66+
return {a => $x};
67+
$$;
68+
69+
SELECT testTextToJsonbObject('abc');
70+
SELECT testTextToJsonbObject(NULL);
71+
72+
6073
CREATE FUNCTION roundtrip(val jsonb, ref text = '') RETURNS jsonb
6174
LANGUAGE plperlu
6275
TRANSFORM FOR TYPE jsonb

contrib/pg_standby/pg_standby.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ char *triggerPath; /* where to find the trigger file? */
5858
char *xlogFilePath; /* where we are going to restore to */
5959
char *nextWALFileName; /* the file we need to get from archive */
6060
char *restartWALFileName; /* the file from which we can restart restore */
61-
char *priorWALFileName; /* the file we need to get from archive */
6261
char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */
6362
char restoreCommand[MAXPGPATH]; /* run this to restore */
6463
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to get

contrib/pgcrypto/pgp-pgsql.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ pgp_pub_decrypt_text(PG_FUNCTION_ARGS)
761761
*/
762762

763763
/*
764-
* Helper function for pgp_armor. Converts arrays of keys and values into
764+
* Helper function for pg_armor. Converts arrays of keys and values into
765765
* plain C arrays, and checks that they don't contain invalid characters.
766766
*/
767767
static int

contrib/pgcrypto/px.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ void *px_realloc(void *p, size_t s);
5050
void px_free(void *p);
5151
#endif
5252

53-
/* max len of 'type' parms */
54-
#define PX_MAX_NAMELEN 128
55-
5653
/* max salt returned */
5754
#define PX_MAX_SALT_LEN 128
5855

contrib/pgcrypto/sha1.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ static uint32 _K[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6};
5959
#define BCOUNT (ctxt->c.b64[0] / 8)
6060
#define W(n) (ctxt->m.b32[(n)])
6161

62-
#define PUTBYTE(x) \
63-
do { \
64-
ctxt->m.b8[(COUNT % 64)] = (x); \
65-
COUNT++; \
66-
COUNT %= 64; \
67-
ctxt->c.b64[0] += 8; \
68-
if (COUNT % 64 == 0) \
69-
sha1_step(ctxt); \
70-
} while (0)
71-
7262
#define PUTPAD(x) \
7363
do { \
7464
ctxt->m.b8[(COUNT % 64)] = (x); \

contrib/postgres_fdw/postgres_fdw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ estimate_path_cost_size(PlannerInfo *root,
27942794

27952795
/*
27962796
* Back into an estimate of the number of retrieved rows. Just in
2797-
* case this is nuts, clamp to at most nrow.
2797+
* case this is nuts, clamp to at most nrows.
27982798
*/
27992799
retrieved_rows = clamp_row_est(rows / fpinfo->local_conds_sel);
28002800
retrieved_rows = Min(retrieved_rows, nrows);

contrib/sepgsql/sepgsql.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ extern void sepgsql_avc_init(void);
271271
*/
272272
extern char *sepgsql_get_client_label(void);
273273
extern void sepgsql_init_client_label(void);
274-
extern char *sepgsql_get_label(Oid relOid, Oid objOid, int32 subId);
274+
extern char *sepgsql_get_label(Oid classId, Oid objectId, int32 subId);
275275

276276
extern void sepgsql_object_relabel(const ObjectAddress *object,
277277
const char *seclabel);

contrib/test_decoding/test_decoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
PG_MODULE_MAGIC;
2626

27-
/* These must be available to pg_dlsym() */
27+
/* These must be available to dlsym() */
2828
extern void _PG_init(void);
2929
extern void _PG_output_plugin_init(OutputPluginCallbacks *cb);
3030

doc/src/sgml/config.sgml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5883,13 +5883,12 @@ local0.* /var/log/postgresql
58835883
<para>
58845884
Causes the duration of each completed statement to be logged
58855885
if the statement ran for at least the specified number of
5886-
milliseconds, modulated by <varname>log_statement_sample_rate</varname>.
5887-
Setting this to zero prints all statement durations.
5888-
<literal>-1</literal> (the default) disables logging statements due to
5889-
exceeding duration threshold; for example, if you set it to
5890-
<literal>250ms</literal>, then all SQL statements that run 250ms or
5891-
longer will be logged. Enabling this parameter can be helpful in
5892-
tracking down unoptimized queries in your applications.
5886+
milliseconds. Setting this to zero prints all statement durations.
5887+
Minus-one (the default) disables logging statement durations.
5888+
For example, if you set it to <literal>250ms</literal>
5889+
then all SQL statements that run 250ms or longer will be
5890+
logged. Enabling this parameter can be helpful in tracking down
5891+
unoptimized queries in your applications.
58935892
Only superusers can change this setting.
58945893
</para>
58955894

@@ -5915,27 +5914,6 @@ local0.* /var/log/postgresql
59155914
</listitem>
59165915
</varlistentry>
59175916

5918-
<varlistentry id="guc-log-statement-sample-rate" xreflabel="log_statement_sample_rate">
5919-
<term><varname>log_statement_sample_rate</varname> (<type>real</type>)
5920-
<indexterm>
5921-
<primary><varname>log_statement_sample_rate</varname> configuration parameter</primary>
5922-
</indexterm>
5923-
</term>
5924-
<listitem>
5925-
<para>
5926-
Determines the fraction of statements that exceed
5927-
<xref linkend="guc-log-min-duration-statement"/> to be logged.
5928-
The default is <literal>1.0</literal>, meaning log all such
5929-
statements.
5930-
Setting this to zero disables logging by duration, same as setting
5931-
<varname>log_min_duration_statement</varname> to
5932-
<literal>-1</literal>.
5933-
<varname>log_statement_sample_rate</varname> is helpful when the
5934-
traffic is too high to log all queries.
5935-
</para>
5936-
</listitem>
5937-
</varlistentry>
5938-
59395917
<varlistentry id="guc-log-transaction-sample-rate" xreflabel="log_transaction_sample_rate">
59405918
<term><varname>log_transaction_sample_rate</varname> (<type>real</type>)
59415919
<indexterm>
@@ -7291,6 +7269,10 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
72917269
be searched <emphasis>before</emphasis> searching any of the path items.
72927270
</para>
72937271

7272+
<!-- To further split hairs, funcname('foo') does not use the temporary
7273+
schema, even when it considers typname='funcname'. This paragraph
7274+
refers to function names in a loose sense, "pg_proc.proname or
7275+
func_name grammar production". -->
72947276
<para>
72957277
Likewise, the current session's temporary-table schema,
72967278
<literal>pg_temp_<replaceable>nnn</replaceable></literal>, is always searched if it

doc/src/sgml/libpq.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5509,7 +5509,7 @@ int PQendcopy(PGconn *conn);
55095509
It should either be issued when the last string has been sent
55105510
to the server using <xref linkend="libpq-PQputline"/> or when the
55115511
last string has been received from the server using
5512-
<function>PGgetline</function>. It must be issued or the server
5512+
<function>PQgetline</function>. It must be issued or the server
55135513
will get <quote>out of sync</quote> with the client. Upon return
55145514
from this function, the server is ready to receive the next SQL
55155515
command. The return value is 0 on successful completion,

doc/src/sgml/ref/set_role.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ RESET ROLE
7070
effectively drops all the privileges assigned directly to the session user
7171
and to the other roles it is a member of, leaving only the privileges
7272
available to the named role. On the other hand, if the session user role
73-
has the <literal>NOINHERITS</literal> attribute, <command>SET ROLE</command> drops the
73+
has the <literal>NOINHERIT</literal> attribute, <command>SET ROLE</command> drops the
7474
privileges assigned directly to the session user and instead acquires the
7575
privileges available to the named role.
7676
</para>

doc/src/sgml/sslinfo.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ countryName (alias C)
185185
localityName (alias L)
186186
stateOrProvinceName (alias ST)
187187
organizationName (alias O)
188-
organizationUnitName (alias OU)
188+
organizationalUnitName (alias OU)
189189
title
190190
description
191191
initials

src/backend/access/gin/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ is stored in the higher bits. That requires 43 bits in total, which
270270
conveniently fits in at most 6 bytes.
271271

272272
A compressed posting list is passed around and stored on disk in a
273-
PackedPostingList struct. The first item in the list is stored uncompressed
273+
GinPostingList struct. The first item in the list is stored uncompressed
274274
as a regular ItemPointerData, followed by the length of the list in bytes,
275275
followed by the packed items.
276276

src/backend/access/gin/ginbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ ginPlaceToPage(GinBtree btree, GinBtreeStack *stack,
650650
}
651651
else
652652
{
653-
elog(ERROR, "invalid return code from GIN placeToPage method: %d", rc);
653+
elog(ERROR, "invalid return code from GIN beginPlaceToPage method: %d", rc);
654654
result = false; /* keep compiler quiet */
655655
}
656656

src/backend/access/gist/gistget.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ gistkillitems(IndexScanDesc scan)
7474

7575
/*
7676
* Mark all killedItems as dead. We need no additional recheck, because,
77-
* if page was modified, pageLSN must have changed.
77+
* if page was modified, curPageLSN must have changed.
7878
*/
7979
for (i = 0; i < so->numKilled; i++)
8080
{
@@ -379,11 +379,11 @@ gistScanPage(IndexScanDesc scan, GISTSearchItem *pageItem, double *myDistances,
379379

380380
/*
381381
* Check if the page was deleted after we saw the downlink. There's
382-
* nothing of interest on a deleted page. Note that we must do this
383-
* after checking the NSN for concurrent splits! It's possible that
384-
* the page originally contained some tuples that are visible to us,
385-
* but was split so that all the visible tuples were moved to another
386-
* page, and then this page was deleted.
382+
* nothing of interest on a deleted page. Note that we must do this after
383+
* checking the NSN for concurrent splits! It's possible that the page
384+
* originally contained some tuples that are visible to us, but was split
385+
* so that all the visible tuples were moved to another page, and then
386+
* this page was deleted.
387387
*/
388388
if (GistPageIsDeleted(page))
389389
{

src/backend/access/hash/hash_xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ hash_xlog_squeeze_page(XLogReaderState *record)
706706

707707
/*
708708
* if the page on which are adding tuples is a page previous to freed
709-
* overflow page, then update its nextblno.
709+
* overflow page, then update its nextblkno.
710710
*/
711711
if (xldata->is_prev_bucket_same_wrt)
712712
{

src/backend/access/hash/hashinsert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ _hash_doinsert(Relation rel, IndexTuple itup, Relation heapRel)
257257
* _hash_pgaddtup() -- add a tuple to a particular page in the index.
258258
*
259259
* This routine adds the tuple to the page as requested; it does not write out
260-
* the page. It is an error to call pgaddtup() without pin and write lock on
261-
* the target buffer.
260+
* the page. It is an error to call this function without pin and write lock
261+
* on the target buffer.
262262
*
263263
* Returns the offset number at which the tuple was inserted. This function
264264
* is responsible for preserving the condition that tuples in a hash index

src/backend/access/heap/heapam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static HeapTuple heap_prepare_insert(Relation relation, HeapTuple tup,
7474
TransactionId xid, CommandId cid, int options);
7575
static XLogRecPtr log_heap_update(Relation reln, Buffer oldbuf,
7676
Buffer newbuf, HeapTuple oldtup,
77-
HeapTuple newtup, HeapTuple old_key_tup,
77+
HeapTuple newtup, HeapTuple old_key_tuple,
7878
bool all_visible_cleared, bool new_all_visible_cleared);
7979
static Bitmapset *HeapDetermineModifiedColumns(Relation relation,
8080
Bitmapset *interesting_cols,

src/backend/access/heap/visibilitymap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124

125125
/* prototypes for internal routines */
126126
static Buffer vm_readbuf(Relation rel, BlockNumber blkno, bool extend);
127-
static void vm_extend(Relation rel, BlockNumber nvmblocks);
127+
static void vm_extend(Relation rel, BlockNumber vm_nblocks);
128128

129129

130130
/*

src/backend/access/nbtree/nbtsort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ _bt_blwritepage(BTWriteState *wstate, Page page, BlockNumber blkno)
657657
/* XLOG stuff */
658658
if (wstate->btws_use_wal)
659659
{
660-
/* We use the heap NEWPAGE record type for this */
660+
/* We use the XLOG_FPI record type for this */
661661
log_newpage(&wstate->index->rd_node, MAIN_FORKNUM, blkno, page, true);
662662
}
663663

src/backend/access/transam/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ void XLogResetInsertion(void)
530530
construction workspace. This is only needed if you have already called
531531
XLogBeginInsert(), but decide to not insert the record after all.
532532

533-
void XLogEnsureRecordSpace(int max_block_id, int nrdatas)
533+
void XLogEnsureRecordSpace(int max_block_id, int ndatas)
534534

535535
Normally, the WAL record construction buffers have the following limits:
536536

src/backend/access/transam/clog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int ZeroCLOGPage(int pageno, bool writeXlog);
9292
static bool CLOGPagePrecedes(int page1, int page2);
9393
static void WriteZeroPageXlogRec(int pageno);
9494
static void WriteTruncateXlogRec(int pageno, TransactionId oldestXact,
95-
Oid oldestXidDb);
95+
Oid oldestXactDb);
9696
static void TransactionIdSetPageStatus(TransactionId xid, int nsubxids,
9797
TransactionId *subxids, XidStatus status,
9898
XLogRecPtr lsn, int pageno,

src/backend/access/transam/multixact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ typedef struct MultiXactStateData
282282
} MultiXactStateData;
283283

284284
/*
285-
* Last element of OldestMemberMXactID and OldestVisibleMXactId arrays.
285+
* Last element of OldestMemberMXactId and OldestVisibleMXactId arrays.
286286
* Valid elements are (1..MaxOldestSlot); element 0 is never used.
287287
*/
288288
#define MaxOldestSlot (MaxBackends + max_prepared_xacts)

0 commit comments

Comments
 (0)