Skip to content

Commit 48169ce

Browse files
committed
Fix merge conflict in the start.sgml
2 parents 1a4134a + 815a31c commit 48169ce

File tree

12 files changed

+93
-14
lines changed

12 files changed

+93
-14
lines changed

doc/src/sgml/start.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ mydb=>
340340
mydb=#
341341
</screen>
342342
That would mean you are a database superuser, which is most likely
343-
the case if you installed <productname>&productname;</productname>
344-
yourself. Being a superuser means that you are not subject to
343+
the case if you installed the <productname>&productname;</productname>
344+
instance yourself. Being a superuser means that you are not subject to
345345
access controls. For the purposes of this tutorial that is not
346346
important.
347347
</para>

src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@ InitBufferPoolAccess(void)
21452145

21462146
MemSet(&hash_ctl, 0, sizeof(hash_ctl));
21472147
hash_ctl.keysize = sizeof(int32);
2148-
hash_ctl.entrysize = sizeof(PrivateRefCountArray);
2148+
hash_ctl.entrysize = sizeof(PrivateRefCountEntry);
21492149

21502150
PrivateRefCountHash = hash_create("PrivateRefCount", 100, &hash_ctl,
21512151
HASH_ELEM | HASH_BLOBS);

src/backend/utils/adt/jsonb.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ jsonb_object_two_arg(PG_FUNCTION_ARGS)
14551455
errmsg("wrong number of array subscripts")));
14561456

14571457
if (nkdims == 0)
1458-
PG_RETURN_DATUM(CStringGetTextDatum("{}"));
1458+
goto close_object;
14591459

14601460
deconstruct_array(key_array,
14611461
TEXTOID, -1, false, 'i',
@@ -1509,13 +1509,14 @@ jsonb_object_two_arg(PG_FUNCTION_ARGS)
15091509
(void) pushJsonbValue(&result.parseState, WJB_VALUE, &v);
15101510
}
15111511

1512-
result.res = pushJsonbValue(&result.parseState, WJB_END_OBJECT, NULL);
1513-
15141512
pfree(key_datums);
15151513
pfree(key_nulls);
15161514
pfree(val_datums);
15171515
pfree(val_nulls);
15181516

1517+
close_object:
1518+
result.res = pushJsonbValue(&result.parseState, WJB_END_OBJECT, NULL);
1519+
15191520
PG_RETURN_POINTER(JsonbValueToJsonb(result.res));
15201521
}
15211522

src/bin/pgbench/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/exprparse.c
22
/exprscan.c
33
/pgbench
4+
/tmp_check/

src/bin/pgbench/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ clean distclean:
4040

4141
maintainer-clean: distclean
4242
rm -f exprparse.c exprscan.c
43+
44+
check:
45+
$(prove_check)
46+
47+
installcheck:
48+
$(prove_installcheck)

src/bin/pgbench/t/001_pgbench.pl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use strict;
2+
use warnings;
3+
4+
use TestLib;
5+
use Test::More tests => 3;
6+
7+
# Test concurrent insertion into table with UNIQUE oid column. DDL expects
8+
# GetNewOidWithIndex() to successfully avoid violating uniqueness for indexes
9+
# like pg_class_oid_index and pg_proc_oid_index. This indirectly exercises
10+
# LWLock and spinlock concurrency. This test makes a 5-MiB table.
11+
my $tempdir = tempdir;
12+
start_test_server $tempdir;
13+
psql('postgres',
14+
'CREATE UNLOGGED TABLE oid_tbl () WITH OIDS; '
15+
. 'ALTER TABLE oid_tbl ADD UNIQUE (oid);');
16+
my $script = "$tempdir/pgbench_script";
17+
open my $fh, ">", $script or die "could not open file $script";
18+
print $fh 'INSERT INTO oid_tbl SELECT FROM generate_series(1,1000);';
19+
close $fh;
20+
command_like(
21+
[ qw(pgbench --no-vacuum --client=5 --protocol=prepared
22+
--transactions=25 --file), $script, 'postgres' ],
23+
qr{processed: 125/125},
24+
'concurrent OID generation');

src/include/port/atomics/generic-xlc.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,23 @@ static inline bool
4646
pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr,
4747
uint32 *expected, uint32 newval)
4848
{
49+
/*
50+
* XXX: __compare_and_swap is defined to take signed parameters, but that
51+
* shouldn't matter since we don't perform any arithmetic operations.
52+
*/
53+
bool ret = __compare_and_swap((volatile int*)&ptr->value,
54+
(int *)expected, (int)newval);
55+
4956
/*
5057
* xlc's documentation tells us:
5158
* "If __compare_and_swap is used as a locking primitive, insert a call to
5259
* the __isync built-in function at the start of any critical sections."
60+
*
61+
* The critical section begins immediately after __compare_and_swap().
5362
*/
5463
__isync();
5564

56-
/*
57-
* XXX: __compare_and_swap is defined to take signed parameters, but that
58-
* shouldn't matter since we don't perform any arithmetic operations.
59-
*/
60-
return __compare_and_swap((volatile int*)&ptr->value,
61-
(int *)expected, (int)newval);
65+
return ret;
6266
}
6367

6468
#define PG_HAVE_ATOMIC_FETCH_ADD_U32
@@ -75,10 +79,12 @@ static inline bool
7579
pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr,
7680
uint64 *expected, uint64 newval)
7781
{
82+
bool ret = __compare_and_swaplp((volatile long*)&ptr->value,
83+
(long *)expected, (long)newval);
84+
7885
__isync();
7986

80-
return __compare_and_swaplp((volatile long*)&ptr->value,
81-
(long *)expected, (long)newval);;
87+
return ret;
8288
}
8389

8490
#define PG_HAVE_ATOMIC_FETCH_ADD_U64

src/test/regress/expected/json.out

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,20 @@ INSERT INTO foo VALUES (999999, NULL, 'bar');
15101510
SELECT json_object_agg(name, type) FROM foo;
15111511
ERROR: field name must not be null
15121512
-- json_object
1513+
-- empty object, one dimension
1514+
SELECT json_object('{}');
1515+
json_object
1516+
-------------
1517+
{}
1518+
(1 row)
1519+
1520+
-- empty object, two dimensions
1521+
SELECT json_object('{}', '{}');
1522+
json_object
1523+
-------------
1524+
{}
1525+
(1 row)
1526+
15131527
-- one dimension
15141528
SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
15151529
json_object

src/test/regress/expected/jsonb.out

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,20 @@ INSERT INTO foo VALUES (999999, NULL, 'bar');
14101410
SELECT jsonb_object_agg(name, type) FROM foo;
14111411
ERROR: field name must not be null
14121412
-- jsonb_object
1413+
-- empty object, one dimension
1414+
SELECT jsonb_object('{}');
1415+
jsonb_object
1416+
--------------
1417+
{}
1418+
(1 row)
1419+
1420+
-- empty object, two dimensions
1421+
SELECT jsonb_object('{}', '{}');
1422+
jsonb_object
1423+
--------------
1424+
{}
1425+
(1 row)
1426+
14131427
-- one dimension
14141428
SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
14151429
jsonb_object

src/test/regress/sql/json.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,12 @@ SELECT json_object_agg(name, type) FROM foo;
462462

463463
-- json_object
464464

465+
-- empty object, one dimension
466+
SELECT json_object('{}');
467+
468+
-- empty object, two dimensions
469+
SELECT json_object('{}', '{}');
470+
465471
-- one dimension
466472
SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
467473

src/test/regress/sql/jsonb.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ SELECT jsonb_object_agg(name, type) FROM foo;
352352

353353
-- jsonb_object
354354

355+
-- empty object, one dimension
356+
SELECT jsonb_object('{}');
357+
358+
-- empty object, two dimensions
359+
SELECT jsonb_object('{}', '{}');
360+
355361
-- one dimension
356362
SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
357363

src/tools/msvc/clean.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ if exist src\bin\pg_basebackup\tmp_check rd /s /q src\bin\pg_basebackup\tmp_chec
9494
if exist src\bin\pg_config\tmp_check rd /s /q src\bin\pg_config\tmp_check
9595
if exist src\bin\pg_ctl\tmp_check rd /s /q src\bin\pg_ctl\tmp_check
9696
if exist src\bin\pg_rewind\tmp_check rd /s /q src\bin\pg_rewind\tmp_check
97+
if exist src\bin\pgbench\tmp_check rd /s /q src\bin\pgbench\tmp_check
9798
if exist src\bin\scripts\tmp_check rd /s /q src\bin\scripts\tmp_check
9899

99100
REM Clean up datafiles built with contrib

0 commit comments

Comments
 (0)