Skip to content

Commit fa4c4cf

Browse files
authored
Merge pull request #676 from jiaoshuntian/merge_pg_master2
Merge pg master from 2024.1.23 to 2024.2.14
2 parents 7f57daf + f9e5c3c commit fa4c4cf

462 files changed

Lines changed: 21481 additions & 6548 deletions

File tree

Some content is hidden

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

.cirrus.tasks.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ task:
172172
su postgres <<-EOF
173173
meson setup \
174174
--buildtype=debug \
175-
-Dcassert=true -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
175+
-Dcassert=true -Dinjection_points=true \
176+
-Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
176177
-DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
177178
-Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
178179
build
@@ -327,8 +328,8 @@ task:
327328
configure_script: |
328329
su postgres <<-EOF
329330
./configure \
330-
--enable-cassert --enable-debug --enable-tap-tests \
331-
--enable-nls \
331+
--enable-cassert --enable-injection-points --enable-debug \
332+
--enable-tap-tests --enable-nls \
332333
--with-segsize-blocks=6 \
333334
\
334335
${LINUX_CONFIGURE_FEATURES} \
@@ -357,7 +358,7 @@ task:
357358
su postgres <<-EOF
358359
meson setup \
359360
--buildtype=debug \
360-
-Dcassert=true \
361+
-Dcassert=true -Dinjection_points=true \
361362
${LINUX_MESON_FEATURES} \
362363
-DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
363364
build
@@ -370,7 +371,7 @@ task:
370371
export CC='ccache gcc -m32'
371372
meson setup \
372373
--buildtype=debug \
373-
-Dcassert=true \
374+
-Dcassert=true -Dinjection_points=true \
374375
${LINUX_MESON_FEATURES} \
375376
-Dllvm=disabled \
376377
--pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
@@ -482,7 +483,7 @@ task:
482483
--buildtype=debug \
483484
-Dextra_include_dirs=/opt/local/include \
484485
-Dextra_lib_dirs=/opt/local/lib \
485-
-Dcassert=true \
486+
-Dcassert=true -Dinjection_points=true \
486487
-Duuid=e2fs -Ddtrace=auto \
487488
-DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
488489
build
@@ -556,7 +557,7 @@ task:
556557
# Use /DEBUG:FASTLINK to avoid high memory usage during linking
557558
configure_script: |
558559
vcvarsall x64
559-
meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% -DPG_TEST_EXTRA="%PG_TEST_EXTRA%" build
560+
meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% -DPG_TEST_EXTRA="%PG_TEST_EXTRA%" build
560561
561562
build_script: |
562563
vcvarsall x64
@@ -616,7 +617,7 @@ task:
616617
617618
# disable -Dnls as the number of files it creates cause a noticable slowdown
618619
configure_script: |
619-
%BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
620+
%BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
620621
621622
build_script: |
622623
%BASH% -c "ninja -C build"

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#
1515
# $ git log --pretty=format:"%H # %cd%n# %s" $PGINDENTGITHASH -1 --date=iso
1616

17+
49e7c6f78ed608c5d5454080ae19c0e7f1b09a04 # 2024-02-09 11:05:01 +0900
18+
# Fix indentation of copyto.c
19+
1720
96c019ffa3f883d139709ea0cfe76dc1bce0f1f8 # 2024-01-13 13:54:11 -0500
1821
# Re-pgindent catcache.c after previous commit.
1922

config/llvm.m4

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ AC_DEFUN([PGAC_LLVM_SUPPORT],
1313
AC_REQUIRE([AC_PROG_AWK])
1414
1515
AC_ARG_VAR(LLVM_CONFIG, [path to llvm-config command])
16-
PGAC_PATH_PROGS(LLVM_CONFIG, llvm-config llvm-config-7 llvm-config-6.0 llvm-config-5.0 llvm-config-4.0 llvm-config-3.9)
16+
PGAC_PATH_PROGS(LLVM_CONFIG, llvm-config llvm-config-17 llvm-config-16 llvm-config-15 llvm-config-14 llvm-config-13 llvm-config-12 llvm-config-11 llvm-config-10)
1717
1818
# no point continuing if llvm wasn't found
1919
if test -z "$LLVM_CONFIG"; then
@@ -25,14 +25,14 @@ AC_DEFUN([PGAC_LLVM_SUPPORT],
2525
AC_MSG_ERROR([$LLVM_CONFIG does not work])
2626
fi
2727
# and whether the version is supported
28-
if echo $pgac_llvm_version | $AWK -F '.' '{ if ([$]1 >= 4 || ([$]1 == 3 && [$]2 >= 9)) exit 1; else exit 0;}';then
29-
AC_MSG_ERROR([$LLVM_CONFIG version is $pgac_llvm_version but at least 3.9 is required])
28+
if echo $pgac_llvm_version | $AWK -F '.' '{ if ([$]1 >= 10) exit 1; else exit 0;}';then
29+
AC_MSG_ERROR([$LLVM_CONFIG version is $pgac_llvm_version but at least 10 is required])
3030
fi
3131
AC_MSG_NOTICE([using llvm $pgac_llvm_version])
3232
3333
# need clang to create some bitcode files
3434
AC_ARG_VAR(CLANG, [path to clang compiler to generate bitcode])
35-
PGAC_PATH_PROGS(CLANG, clang clang-7 clang-6.0 clang-5.0 clang-4.0 clang-3.9)
35+
PGAC_PATH_PROGS(CLANG, clang clang-17 clang-16 clang-15 clang-14 clang-13 clang-12 clang-11 clang-10)
3636
if test -z "$CLANG"; then
3737
AC_MSG_ERROR([clang not found, but required when compiling --with-llvm, specify with CLANG=])
3838
fi
@@ -115,8 +115,6 @@ AC_DEFUN([PGAC_CHECK_LLVM_FUNCTIONS],
115115
# Check which functionality is present
116116
SAVE_CPPFLAGS="$CPPFLAGS"
117117
CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
118-
AC_CHECK_DECLS([LLVMOrcGetSymbolAddressIn], [], [], [[#include <llvm-c/OrcBindings.h>]])
119-
AC_CHECK_DECLS([LLVMGetHostCPUName, LLVMGetHostCPUFeatures], [], [], [[#include <llvm-c/TargetMachine.h>]])
120118
AC_CHECK_DECLS([LLVMCreateGDBRegistrationListener, LLVMCreatePerfJITEventListener], [], [], [[#include <llvm-c/ExecutionEngine.h>]])
121119
CPPFLAGS="$SAVE_CPPFLAGS"
122120
])# PGAC_CHECK_LLVM_FUNCTIONS

configure

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5209,7 +5209,7 @@ if test "$with_llvm" = yes; then :
52095209

52105210

52115211
if test -z "$LLVM_CONFIG"; then
5212-
for ac_prog in llvm-config llvm-config-7 llvm-config-6.0 llvm-config-5.0 llvm-config-4.0 llvm-config-3.9
5212+
for ac_prog in llvm-config llvm-config-17 llvm-config-16 llvm-config-15 llvm-config-14 llvm-config-13 llvm-config-12 llvm-config-11 llvm-config-10
52135213
do
52145214
# Extract the first word of "$ac_prog", so it can be a program name with args.
52155215
set dummy $ac_prog; ac_word=$2
@@ -5273,16 +5273,16 @@ fi
52735273
as_fn_error $? "$LLVM_CONFIG does not work" "$LINENO" 5
52745274
fi
52755275
# and whether the version is supported
5276-
if echo $pgac_llvm_version | $AWK -F '.' '{ if ($1 >= 4 || ($1 == 3 && $2 >= 9)) exit 1; else exit 0;}';then
5277-
as_fn_error $? "$LLVM_CONFIG version is $pgac_llvm_version but at least 3.9 is required" "$LINENO" 5
5276+
if echo $pgac_llvm_version | $AWK -F '.' '{ if ($1 >= 10) exit 1; else exit 0;}';then
5277+
as_fn_error $? "$LLVM_CONFIG version is $pgac_llvm_version but at least 10 is required" "$LINENO" 5
52785278
fi
52795279
{ $as_echo "$as_me:${as_lineno-$LINENO}: using llvm $pgac_llvm_version" >&5
52805280
$as_echo "$as_me: using llvm $pgac_llvm_version" >&6;}
52815281

52825282
# need clang to create some bitcode files
52835283

52845284
if test -z "$CLANG"; then
5285-
for ac_prog in clang clang-7 clang-6.0 clang-5.0 clang-4.0 clang-3.9
5285+
for ac_prog in clang clang-17 clang-16 clang-15 clang-14 clang-13 clang-12 clang-11 clang-10
52865286
do
52875287
# Extract the first word of "$ac_prog", so it can be a program name with args.
52885288
set dummy $ac_prog; ac_word=$2
@@ -16507,6 +16507,12 @@ esac
1650716507
;;
1650816508
esac
1650916509

16510+
case " $LIBOBJS " in
16511+
*" win32gai_strerror.$ac_objext "* ) ;;
16512+
*) LIBOBJS="$LIBOBJS win32gai_strerror.$ac_objext"
16513+
;;
16514+
esac
16515+
1651016516
case " $LIBOBJS " in
1651116517
*" win32getrusage.$ac_objext "* ) ;;
1651216518
*) LIBOBJS="$LIBOBJS win32getrusage.$ac_objext"
@@ -16665,41 +16671,6 @@ if test "$with_llvm" = yes; then
1666516671
# Check which functionality is present
1666616672
SAVE_CPPFLAGS="$CPPFLAGS"
1666716673
CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
16668-
ac_fn_c_check_decl "$LINENO" "LLVMOrcGetSymbolAddressIn" "ac_cv_have_decl_LLVMOrcGetSymbolAddressIn" "#include <llvm-c/OrcBindings.h>
16669-
"
16670-
if test "x$ac_cv_have_decl_LLVMOrcGetSymbolAddressIn" = xyes; then :
16671-
ac_have_decl=1
16672-
else
16673-
ac_have_decl=0
16674-
fi
16675-
16676-
cat >>confdefs.h <<_ACEOF
16677-
#define HAVE_DECL_LLVMORCGETSYMBOLADDRESSIN $ac_have_decl
16678-
_ACEOF
16679-
16680-
ac_fn_c_check_decl "$LINENO" "LLVMGetHostCPUName" "ac_cv_have_decl_LLVMGetHostCPUName" "#include <llvm-c/TargetMachine.h>
16681-
"
16682-
if test "x$ac_cv_have_decl_LLVMGetHostCPUName" = xyes; then :
16683-
ac_have_decl=1
16684-
else
16685-
ac_have_decl=0
16686-
fi
16687-
16688-
cat >>confdefs.h <<_ACEOF
16689-
#define HAVE_DECL_LLVMGETHOSTCPUNAME $ac_have_decl
16690-
_ACEOF
16691-
ac_fn_c_check_decl "$LINENO" "LLVMGetHostCPUFeatures" "ac_cv_have_decl_LLVMGetHostCPUFeatures" "#include <llvm-c/TargetMachine.h>
16692-
"
16693-
if test "x$ac_cv_have_decl_LLVMGetHostCPUFeatures" = xyes; then :
16694-
ac_have_decl=1
16695-
else
16696-
ac_have_decl=0
16697-
fi
16698-
16699-
cat >>confdefs.h <<_ACEOF
16700-
#define HAVE_DECL_LLVMGETHOSTCPUFEATURES $ac_have_decl
16701-
_ACEOF
16702-
1670316674
ac_fn_c_check_decl "$LINENO" "LLVMCreateGDBRegistrationListener" "ac_cv_have_decl_LLVMCreateGDBRegistrationListener" "#include <llvm-c/ExecutionEngine.h>
1670416675
"
1670516676
if test "x$ac_cv_have_decl_LLVMCreateGDBRegistrationListener" = xyes; then :

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,6 +1958,7 @@ if test "$PORTNAME" = "win32"; then
19581958
AC_LIBOBJ(win32env)
19591959
AC_LIBOBJ(win32error)
19601960
AC_LIBOBJ(win32fdatasync)
1961+
AC_LIBOBJ(win32gai_strerror)
19611962
AC_LIBOBJ(win32getrusage)
19621963
AC_LIBOBJ(win32link)
19631964
AC_LIBOBJ(win32ntdll)

contrib/auto_explain/auto_explain.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
396396
es->wal = (es->analyze && auto_explain_log_wal);
397397
es->timing = (es->analyze && auto_explain_log_timing);
398398
es->summary = es->analyze;
399+
/* No support for MEMORY */
400+
/* es->memory = false; */
399401
es->format = auto_explain_log_format;
400402
es->settings = auto_explain_log_settings;
401403

contrib/btree_gist/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PGFILEDESC = "btree_gist - B-tree equivalent GiST operator classes"
4040
REGRESS = init int2 int4 int8 float4 float8 cash oid timestamp timestamptz \
4141
time timetz date interval macaddr macaddr8 inet cidr text varchar char \
4242
bytea bit varbit numeric uuid not_equal enum bool partitions \
43-
stratnum
43+
stratnum without_overlaps
4444

4545
SHLIB_LINK += $(filter -lm, $(LIBS))
4646

contrib/btree_gist/btree_gist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ gbt_decompress(PG_FUNCTION_ARGS)
5555
}
5656

5757
/*
58-
* Returns the btree number for equals, otherwise invalid.
58+
* Returns the btree number for supported operators, otherwise invalid.
5959
*/
6060
Datum
6161
gist_stratnum_btree(PG_FUNCTION_ARGS)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
-- Core must test WITHOUT OVERLAPS
2+
-- with an int4range + daterange,
3+
-- so here we do some simple tests
4+
-- to make sure int + daterange works too,
5+
-- since that is the expected use-case.
6+
CREATE TABLE temporal_rng (
7+
id integer,
8+
valid_at daterange,
9+
CONSTRAINT temporal_rng_pk PRIMARY KEY (id, valid_at WITHOUT OVERLAPS)
10+
);
11+
\d temporal_rng
12+
Table "public.temporal_rng"
13+
Column | Type | Collation | Nullable | Default
14+
----------+-----------+-----------+----------+---------
15+
id | integer | | not null |
16+
valid_at | daterange | | not null |
17+
Indexes:
18+
"temporal_rng_pk" PRIMARY KEY (id, valid_at WITHOUT OVERLAPS)
19+
20+
SELECT pg_get_constraintdef(oid) FROM pg_constraint WHERE conname = 'temporal_rng_pk';
21+
pg_get_constraintdef
22+
---------------------------------------------
23+
PRIMARY KEY (id, valid_at WITHOUT OVERLAPS)
24+
(1 row)
25+
26+
SELECT pg_get_indexdef(conindid, 0, true) FROM pg_constraint WHERE conname = 'temporal_rng_pk';
27+
pg_get_indexdef
28+
-------------------------------------------------------------------------------
29+
CREATE UNIQUE INDEX temporal_rng_pk ON temporal_rng USING gist (id, valid_at)
30+
(1 row)
31+
32+
INSERT INTO temporal_rng VALUES
33+
(1, '[2000-01-01,2001-01-01)');
34+
-- same key, doesn't overlap:
35+
INSERT INTO temporal_rng VALUES
36+
(1, '[2001-01-01,2002-01-01)');
37+
-- overlaps but different key:
38+
INSERT INTO temporal_rng VALUES
39+
(2, '[2000-01-01,2001-01-01)');
40+
-- should fail:
41+
INSERT INTO temporal_rng VALUES
42+
(1, '[2000-06-01,2001-01-01)');
43+
ERROR: conflicting key value violates exclusion constraint "temporal_rng_pk"
44+
DETAIL: Key (id, valid_at)=(1, [06-01-2000,01-01-2001)) conflicts with existing key (id, valid_at)=(1, [01-01-2000,01-01-2001)).

contrib/btree_gist/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ tests += {
9191
'bool',
9292
'partitions',
9393
'stratnum',
94+
'without_overlaps',
9495
],
9596
},
9697
}

0 commit comments

Comments
 (0)