aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure15
-rw-r--r--configure.ac3
-rw-r--r--contrib/sepgsql/t/001_sepgsql.pl2
-rw-r--r--meson.build14
-rw-r--r--src/backend/optimizer/path/allpaths.c12
-rw-r--r--src/backend/utils/cache/syscache.c2
-rw-r--r--src/include/access/gin_tuple.h2
-rw-r--r--src/include/pg_config.h.in7
-rw-r--r--src/include/storage/waiteventset.h2
-rw-r--r--src/interfaces/ecpg/preproc/meson.build2
-rw-r--r--src/port/explicit_bzero.c4
-rw-r--r--src/port/pg_localeconv_r.c2
-rw-r--r--src/test/regress/expected/partition_join.out18
-rw-r--r--src/test/regress/sql/partition_join.sql3
-rw-r--r--src/tools/RELEASE_CHANGES3
15 files changed, 72 insertions, 19 deletions
diff --git a/configure b/configure
index 275c67ee67c..4f15347cc95 100755
--- a/configure
+++ b/configure
@@ -15616,7 +15616,7 @@ fi
LIBS_including_readline="$LIBS"
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
-for ac_func in backtrace_symbols copyfile copy_file_range elf_aux_info getauxval getifaddrs getpeerucred inet_pton kqueue localeconv_l mbstowcs_l memset_s posix_fallocate ppoll pthread_is_threaded_np setproctitle setproctitle_fast strsignal syncfs sync_file_range uselocale wcstombs_l
+for ac_func in backtrace_symbols copyfile copy_file_range elf_aux_info getauxval getifaddrs getpeerucred inet_pton kqueue localeconv_l mbstowcs_l posix_fallocate ppoll pthread_is_threaded_np setproctitle setproctitle_fast strsignal syncfs sync_file_range uselocale wcstombs_l
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16192,6 +16192,19 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRCHRNUL $ac_have_decl
_ACEOF
+ac_fn_c_check_decl "$LINENO" "memset_s" "ac_cv_have_decl_memset_s" "#define __STDC_WANT_LIB_EXT1__ 1
+#include <string.h>
+"
+if test "x$ac_cv_have_decl_memset_s" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MEMSET_S $ac_have_decl
+_ACEOF
+
# This is probably only present on macOS, but may as well check always
ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
diff --git a/configure.ac b/configure.ac
index 7ea91d56adb..4b8335dc613 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1792,7 +1792,6 @@ AC_CHECK_FUNCS(m4_normalize([
kqueue
localeconv_l
mbstowcs_l
- memset_s
posix_fallocate
ppoll
pthread_is_threaded_np
@@ -1838,6 +1837,8 @@ AC_CHECK_DECLS([strlcat, strlcpy, strnlen, strsep, timingsafe_bcmp])
AC_CHECK_DECLS([preadv], [], [], [#include <sys/uio.h>])
AC_CHECK_DECLS([pwritev], [], [], [#include <sys/uio.h>])
AC_CHECK_DECLS([strchrnul], [], [], [#include <string.h>])
+AC_CHECK_DECLS([memset_s], [], [], [#define __STDC_WANT_LIB_EXT1__ 1
+#include <string.h>])
# This is probably only present on macOS, but may as well check always
AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>])
diff --git a/contrib/sepgsql/t/001_sepgsql.pl b/contrib/sepgsql/t/001_sepgsql.pl
index cd00e4963db..f5e4645e4e6 100644
--- a/contrib/sepgsql/t/001_sepgsql.pl
+++ b/contrib/sepgsql/t/001_sepgsql.pl
@@ -1,5 +1,5 @@
-# Copyright (c) 2024, PostgreSQL Global Development Group
+# Copyright (c) 2024-2025, PostgreSQL Global Development Group
use strict;
use warnings FATAL => 'all';
diff --git a/meson.build b/meson.build
index 12de5e80c31..d142e3e408b 100644
--- a/meson.build
+++ b/meson.build
@@ -2654,6 +2654,7 @@ decl_checks += [
['preadv', 'sys/uio.h'],
['pwritev', 'sys/uio.h'],
['strchrnul', 'string.h'],
+ ['memset_s', 'string.h', '#define __STDC_WANT_LIB_EXT1__ 1'],
]
# Check presence of some optional LLVM functions.
@@ -2667,21 +2668,23 @@ endif
foreach c : decl_checks
func = c.get(0)
header = c.get(1)
- args = c.get(2, {})
+ prologue = c.get(2, '')
+ args = c.get(3, {})
varname = 'HAVE_DECL_' + func.underscorify().to_upper()
found = cc.compiles('''
-#include <@0@>
+@0@
+#include <@1@>
int main()
{
-#ifndef @1@
- (void) @1@;
+#ifndef @2@
+ (void) @2@;
#endif
return 0;
}
-'''.format(header, func),
+'''.format(prologue, header, func),
name: 'test whether @0@ is declared'.format(func),
# need to add cflags_warn to get at least
# -Werror=unguarded-availability-new if applicable
@@ -2880,7 +2883,6 @@ func_checks = [
['kqueue'],
['localeconv_l'],
['mbstowcs_l'],
- ['memset_s'],
['mkdtemp'],
['posix_fadvise'],
['posix_fallocate'],
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 905250b3325..6cc6966b060 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -1891,7 +1891,17 @@ generate_orderedappend_paths(PlannerInfo *root, RelOptInfo *rel,
*/
if (root->tuple_fraction > 0)
{
- double path_fraction = (1.0 / root->tuple_fraction);
+ double path_fraction = root->tuple_fraction;
+
+ /*
+ * Merge Append considers only live children relations. Dummy
+ * relations must be filtered out before.
+ */
+ Assert(childrel->rows > 0);
+
+ /* Convert absolute limit to a path fraction */
+ if (path_fraction >= 1.0)
+ path_fraction /= childrel->rows;
cheapest_fractional =
get_cheapest_fractional_path_for_pathkeys(childrel->pathlist,
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index 95a1d0a2749..f944453a1d8 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -396,7 +396,7 @@ SearchSysCacheCopy(int cacheId,
/*
* SearchSysCacheLockedCopy1
*
- * Meld SearchSysCacheLockedCopy1 with SearchSysCacheCopy(). After the
+ * Meld SearchSysCacheLocked1 with SearchSysCacheCopy(). After the
* caller's heap_update(), it should UnlockTuple(InplaceUpdateTupleLock) and
* heap_freetuple().
*/
diff --git a/src/include/access/gin_tuple.h b/src/include/access/gin_tuple.h
index 4a50565960f..702f7d12889 100644
--- a/src/include/access/gin_tuple.h
+++ b/src/include/access/gin_tuple.h
@@ -2,7 +2,7 @@
* gin.h
* Public header file for Generalized Inverted Index access method.
*
- * Copyright (c) 2006-2024, PostgreSQL Global Development Group
+ * Copyright (c) 2006-2025, PostgreSQL Global Development Group
*
* src/include/access/gin.h
*--------------------------------------------------------------------------
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index c3cc9fa856d..726a7c1be1f 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -91,6 +91,10 @@
`LLVMCreatePerfJITEventListener', and to 0 if you don't. */
#undef HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER
+/* Define to 1 if you have the declaration of `memset_s', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MEMSET_S
+
/* Define to 1 if you have the declaration of `posix_fadvise', and to 0 if you
don't. */
#undef HAVE_DECL_POSIX_FADVISE
@@ -291,9 +295,6 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have the `memset_s' function. */
-#undef HAVE_MEMSET_S
-
/* Define to 1 if you have the `mkdtemp' function. */
#undef HAVE_MKDTEMP
diff --git a/src/include/storage/waiteventset.h b/src/include/storage/waiteventset.h
index aa65b7a35e7..dd514d52991 100644
--- a/src/include/storage/waiteventset.h
+++ b/src/include/storage/waiteventset.h
@@ -15,7 +15,7 @@
* functions.
*
*
- * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/waiteventset.h
diff --git a/src/interfaces/ecpg/preproc/meson.build b/src/interfaces/ecpg/preproc/meson.build
index c9f4035053d..aa948efc0dc 100644
--- a/src/interfaces/ecpg/preproc/meson.build
+++ b/src/interfaces/ecpg/preproc/meson.build
@@ -98,4 +98,4 @@ tests += {
],
'deps': [ecpg_exe],
},
-} \ No newline at end of file
+}
diff --git a/src/port/explicit_bzero.c b/src/port/explicit_bzero.c
index 1d37b119bab..53766e86e94 100644
--- a/src/port/explicit_bzero.c
+++ b/src/port/explicit_bzero.c
@@ -12,9 +12,11 @@
*-------------------------------------------------------------------------
*/
+#define __STDC_WANT_LIB_EXT1__ 1 /* needed to access memset_s() */
+
#include "c.h"
-#if defined(HAVE_MEMSET_S)
+#if HAVE_DECL_MEMSET_S
void
explicit_bzero(void *buf, size_t len)
diff --git a/src/port/pg_localeconv_r.c b/src/port/pg_localeconv_r.c
index 4554ab84e9b..61510b2e0ea 100644
--- a/src/port/pg_localeconv_r.c
+++ b/src/port/pg_localeconv_r.c
@@ -3,7 +3,7 @@
* pg_localeconv_r.c
* Thread-safe implementations of localeconv()
*
- * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/test/regress/expected/partition_join.out b/src/test/regress/expected/partition_join.out
index 6101c8c7cf1..d5368186caa 100644
--- a/src/test/regress/expected/partition_join.out
+++ b/src/test/regress/expected/partition_join.out
@@ -5260,6 +5260,24 @@ SELECT x.id, y.id FROM fract_t x LEFT JOIN fract_t y USING (id) ORDER BY x.id DE
Index Cond: (id = x_2.id)
(11 rows)
+EXPLAIN (COSTS OFF) -- Should use NestLoop with parameterised inner scan
+SELECT x.id, y.id FROM fract_t x LEFT JOIN fract_t y USING (id)
+ORDER BY x.id DESC LIMIT 2;
+ QUERY PLAN
+--------------------------------------------------------------------------------
+ Limit
+ -> Merge Append
+ Sort Key: x.id DESC
+ -> Nested Loop Left Join
+ -> Index Only Scan Backward using fract_t0_pkey on fract_t0 x_1
+ -> Index Only Scan using fract_t0_pkey on fract_t0 y_1
+ Index Cond: (id = x_1.id)
+ -> Nested Loop Left Join
+ -> Index Only Scan Backward using fract_t1_pkey on fract_t1 x_2
+ -> Index Only Scan using fract_t1_pkey on fract_t1 y_2
+ Index Cond: (id = x_2.id)
+(11 rows)
+
--
-- Test Append's fractional paths
--
diff --git a/src/test/regress/sql/partition_join.sql b/src/test/regress/sql/partition_join.sql
index b76c5451001..30f15ee9acb 100644
--- a/src/test/regress/sql/partition_join.sql
+++ b/src/test/regress/sql/partition_join.sql
@@ -1224,6 +1224,9 @@ SELECT x.id, y.id FROM fract_t x LEFT JOIN fract_t y USING (id) ORDER BY x.id AS
EXPLAIN (COSTS OFF)
SELECT x.id, y.id FROM fract_t x LEFT JOIN fract_t y USING (id) ORDER BY x.id DESC LIMIT 10;
+EXPLAIN (COSTS OFF) -- Should use NestLoop with parameterised inner scan
+SELECT x.id, y.id FROM fract_t x LEFT JOIN fract_t y USING (id)
+ORDER BY x.id DESC LIMIT 2;
--
-- Test Append's fractional paths
diff --git a/src/tools/RELEASE_CHANGES b/src/tools/RELEASE_CHANGES
index 94c5a0f3bfb..c0d75c213be 100644
--- a/src/tools/RELEASE_CHANGES
+++ b/src/tools/RELEASE_CHANGES
@@ -89,6 +89,9 @@ Starting a New Development Cycle
* Typically, we do pgindent and perltidy runs just before branching,
as well as before beta (complete steps from src/tools/pgindent/README)
+* It's also advisable to check that copyright years are up-to-date
+ (run src/tools/copyright.pl, commit any changes it finds)
+
* Create a branch in git for maintenance of the previous release
o on master branch, do:
git pull # be sure you have the latest "master"