Skip to content

Commit ef77fd6

Browse files
authored
Merge branch 'apache:main' into main
2 parents e354e6b + a16ad2b commit ef77fd6

92 files changed

Lines changed: 4189 additions & 400 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.

.github/workflows/build-cloudberry-rocky8.yml

Lines changed: 1909 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/build-cloudberry.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ jobs:
309309
},
310310
{"test":"ic-gpcontrib",
311311
"make_configs":["gpcontrib/orafce:installcheck",
312-
"gpcontrib/pxf_fdw:installcheck",
313312
"gpcontrib/zstd:installcheck",
314313
"gpcontrib/gp_sparse_vector:installcheck",
315314
"gpcontrib/gp_toolkit:installcheck",

.github/workflows/build-deb-cloudberry.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ jobs:
248248
},
249249
{"test":"ic-deb-gpcontrib",
250250
"make_configs":["gpcontrib/orafce:installcheck",
251-
"gpcontrib/pxf_fdw:installcheck",
252251
"gpcontrib/zstd:installcheck",
253252
"gpcontrib/gp_sparse_vector:installcheck",
254253
"gpcontrib/gp_toolkit:installcheck"]
@@ -555,8 +554,15 @@ jobs:
555554
exit 1
556555
fi
557556
558-
ARCH="amd64"
559-
CBDB_PKG_VERSION=${CBDB_VERSION}-${BUILD_NUMBER}-$(git --git-dir=.git rev-list HEAD --count).$(git --git-dir=.git rev-parse --short HEAD)
557+
ARCH=$(dpkg --print-architecture)
558+
# Detect OS distribution (e.g., ubuntu22.04, debian12)
559+
if [ -f /etc/os-release ]; then
560+
. /etc/os-release
561+
OS_DISTRO=$(echo "${ID}${VERSION_ID}" | tr '[:upper:]' '[:lower:]')
562+
else
563+
OS_DISTRO="unknown"
564+
fi
565+
CBDB_PKG_VERSION=${CBDB_VERSION}-${BUILD_NUMBER}-${OS_DISTRO}
560566
561567
echo "Produced artifacts"
562568
ls -l ../

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ config.status.lineno
4545
autom4te.cache
4646
configure.lineno
4747
Debug
48-
Release
4948
pgsql.sln
5049
cscope.*
5150
build.sh

configure

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ BISON
698698
MKDIR_P
699699
LN_S
700700
TAR
701+
USE_MDBLOCALES
701702
install_bin
702703
INSTALL_DATA
703704
INSTALL_SCRIPT
@@ -945,6 +946,7 @@ with_rt
945946
with_libcurl
946947
with_apr_config
947948
with_gnu_ld
949+
with_mdblocales
948950
with_ssl
949951
with_openssl
950952
enable_openssl_redirect
@@ -1693,6 +1695,7 @@ Optional Packages:
16931695
--without-libcurl do not use libcurl
16941696
--with-apr-config=PATH path to apr-1-config utility
16951697
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
1698+
--without-mdblocales build without MDB locales
16961699
--with-ssl=LIB use LIB for SSL/TLS support (openssl)
16971700
--with-openssl obsolete spelling of --with-ssl=openssl
16981701

@@ -2909,7 +2912,6 @@ PG_PACKAGE_VERSION=14.4
29092912

29102913

29112914

2912-
29132915
ac_aux_dir=
29142916
for ac_dir in config "$srcdir"/config; do
29152917
if test -f "$ac_dir/install-sh"; then
@@ -12208,6 +12210,38 @@ case $INSTALL in
1220812210
esac
1220912211

1221012212

12213+
#
12214+
# MDB locales
12215+
#
12216+
12217+
12218+
12219+
12220+
# Check whether --with-mdblocales was given.
12221+
if test "${with_mdblocales+set}" = set; then :
12222+
withval=$with_mdblocales;
12223+
case $withval in
12224+
yes)
12225+
12226+
$as_echo "#define USE_MDBLOCALES 1" >>confdefs.h
12227+
12228+
;;
12229+
no)
12230+
:
12231+
;;
12232+
*)
12233+
as_fn_error $? "no argument expected for --with-mdblocales option" "$LINENO" 5
12234+
;;
12235+
esac
12236+
12237+
else
12238+
with_mdblocales=no
12239+
12240+
fi
12241+
12242+
12243+
12244+
1221112245
if test -z "$TAR"; then
1221212246
for ac_prog in tar
1221312247
do
@@ -12844,6 +12878,56 @@ $as_echo "${python_libspec} ${python_additional_libs}" >&6; }
1284412878

1284512879

1284612880

12881+
fi
12882+
12883+
if test "$with_mdblocales" = yes; then
12884+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mdb_setlocale in -lmdblocales" >&5
12885+
$as_echo_n "checking for mdb_setlocale in -lmdblocales... " >&6; }
12886+
if ${ac_cv_lib_mdblocales_mdb_setlocale+:} false; then :
12887+
$as_echo_n "(cached) " >&6
12888+
else
12889+
ac_check_lib_save_LIBS=$LIBS
12890+
LIBS="-lmdblocales $LIBS"
12891+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12892+
/* end confdefs.h. */
12893+
12894+
/* Override any GCC internal prototype to avoid an error.
12895+
Use char because int might match the return type of a GCC
12896+
builtin and then its argument prototype would still apply. */
12897+
#ifdef __cplusplus
12898+
extern "C"
12899+
#endif
12900+
char mdb_setlocale ();
12901+
int
12902+
main ()
12903+
{
12904+
return mdb_setlocale ();
12905+
;
12906+
return 0;
12907+
}
12908+
_ACEOF
12909+
if ac_fn_c_try_link "$LINENO"; then :
12910+
ac_cv_lib_mdblocales_mdb_setlocale=yes
12911+
else
12912+
ac_cv_lib_mdblocales_mdb_setlocale=no
12913+
fi
12914+
rm -f core conftest.err conftest.$ac_objext \
12915+
conftest$ac_exeext conftest.$ac_ext
12916+
LIBS=$ac_check_lib_save_LIBS
12917+
fi
12918+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mdblocales_mdb_setlocale" >&5
12919+
$as_echo "$ac_cv_lib_mdblocales_mdb_setlocale" >&6; }
12920+
if test "x$ac_cv_lib_mdblocales_mdb_setlocale" = xyes; then :
12921+
cat >>confdefs.h <<_ACEOF
12922+
#define HAVE_LIBMDBLOCALES 1
12923+
_ACEOF
12924+
12925+
LIBS="-lmdblocales $LIBS"
12926+
12927+
else
12928+
as_fn_error $? "mdblocales library not found" "$LINENO" 5
12929+
fi
12930+
1284712931
fi
1284812932

1284912933
if test x"$cross_compiling" = x"yes" && test -z "$with_system_tzdata"; then
@@ -17065,6 +17149,17 @@ fi
1706517149

1706617150
done
1706717151

17152+
fi
17153+
17154+
if test "$with_mdblocales" = yes; then
17155+
ac_fn_c_check_header_mongrel "$LINENO" "mdblocales.h" "ac_cv_header_mdblocales_h" "$ac_includes_default"
17156+
if test "x$ac_cv_header_mdblocales_h" = xyes; then :
17157+
17158+
else
17159+
as_fn_error $? "mdblocales header not found." "$LINENO" 5
17160+
fi
17161+
17162+
1706817163
fi
1706917164

1707017165
if test "$with_gssapi" = yes ; then

configure.ac

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,14 @@ case $INSTALL in
14621462
esac
14631463
AC_SUBST(install_bin)
14641464

1465+
#
1466+
# MDB locales
1467+
#
1468+
1469+
PGAC_ARG_BOOL(with, mdblocales, yes, [build without MDB locales],
1470+
[AC_DEFINE([USE_MDBLOCALES], 1, [Define to 1 to build with MDB locales. (--with-mdblocales)])])
1471+
AC_SUBST(USE_MDBLOCALES)
1472+
14651473
PGAC_PATH_PROGS(TAR, tar)
14661474
AC_PROG_LN_S
14671475
AC_PROG_MKDIR_P
@@ -1620,6 +1628,11 @@ failure. It is possible the compiler isn't looking in the proper directory.
16201628
Use --without-zlib to disable zlib support.])])
16211629
fi
16221630

1631+
if test "$with_mdblocales" = yes; then
1632+
AC_CHECK_LIB(mdblocales, mdb_setlocale, [],
1633+
[AC_MSG_ERROR([mdblocales library not found])])
1634+
fi
1635+
16231636
if test "$enable_external_fts" = yes; then
16241637
AC_CHECK_LIB(jansson, jansson_version_str, [],
16251638
[AC_MSG_ERROR([jansson library not found or version is too old, version must >= 2.13])])
@@ -1999,6 +2012,10 @@ if test "$with_lz4" = yes; then
19992012
AC_CHECK_HEADERS(lz4.h, [], [AC_MSG_ERROR([lz4.h header file is required for LZ4])])
20002013
fi
20012014

2015+
if test "$with_mdblocales" = yes; then
2016+
AC_CHECK_HEADER(mdblocales.h, [], [AC_MSG_ERROR([mdblocales header not found.])])
2017+
fi
2018+
20022019
if test "$with_gssapi" = yes ; then
20032020
AC_CHECK_HEADERS(gssapi/gssapi.h, [],
20042021
[AC_CHECK_HEADERS(gssapi.h, [], [AC_MSG_ERROR([gssapi.h header file is required for GSSAPI])])])

contrib/pax_storage/src/cpp/comm/fast_io.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727

2828
#include "fast_io.h"
29-
29+
#include <stdint.h>
3030
#include <unistd.h> // for pread
3131

3232
// uring_likely may not be defined in older liburing versions
@@ -42,7 +42,7 @@ namespace pax
4242
{
4343

4444
bool IOUringFastIO::available() {
45-
static char support_io_uring = 0;
45+
static int8_t support_io_uring = 0;
4646

4747
if (support_io_uring == 1) return true;
4848
if (support_io_uring == -1) return false;
@@ -142,4 +142,4 @@ std::pair<int, int> SyncFastIO::read(int fd, std::vector<IORequest> &request, st
142142
return {retcode, success_read};
143143
}
144144

145-
} // namespace pax
145+
} // namespace pax

contrib/pax_storage/src/cpp/storage/oper/pax_oper.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28+
#include "common/mdb_locale.h"
2829
#include "storage/oper/pax_oper.h"
2930

3031
#include "comm/cbdb_wrappers.h"
@@ -588,9 +589,9 @@ static inline bool LocaleIsC(Oid collation) {
588589
return (bool)result;
589590
}
590591

591-
localeptr = setlocale(LC_COLLATE, NULL);
592+
localeptr = SETLOCALE(LC_COLLATE, NULL);
592593
CBDB_CHECK(localeptr, cbdb::CException::ExType::kExTypeCError,
593-
fmt("Invalid locale, fail to `setlocale`, errno: %d", errno));
594+
fmt("Invalid locale, fail to `SETLOCALE`, errno: %d", errno));
594595

595596
if (strcmp(localeptr, "C") == 0 || // cut line
596597
strcmp(localeptr, "POSIX") == 0) {

contrib/pax_storage/src/test/regress/expected/create_function_3.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ SET SESSION AUTHORIZATION regress_unpriv_user;
166166
SET search_path TO temp_func_test, public;
167167
ALTER FUNCTION functest_E_1(int) NOT LEAKPROOF;
168168
ALTER FUNCTION functest_E_2(int) LEAKPROOF;
169-
ERROR: only superuser can define a leakproof function
169+
ERROR: only superuser or mdb_admin can define a leakproof function
170170
CREATE FUNCTION functest_E_3(int) RETURNS bool LANGUAGE 'sql'
171171
LEAKPROOF AS 'SELECT $1 < 200'; -- fail
172-
ERROR: only superuser can define a leakproof function
172+
ERROR: only superuser or mdb_admin can define a leakproof function
173173
RESET SESSION AUTHORIZATION;
174174
--
175175
-- CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT

contrib/pax_storage/src/test/regress/expected/create_function_3_optimizer.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ SET SESSION AUTHORIZATION regress_unpriv_user;
166166
SET search_path TO temp_func_test, public;
167167
ALTER FUNCTION functest_E_1(int) NOT LEAKPROOF;
168168
ALTER FUNCTION functest_E_2(int) LEAKPROOF;
169-
ERROR: only superuser can define a leakproof function
169+
ERROR: only superuser or mdb_admin can define a leakproof function
170170
CREATE FUNCTION functest_E_3(int) RETURNS bool LANGUAGE 'sql'
171171
LEAKPROOF AS 'SELECT $1 < 200'; -- fail
172-
ERROR: only superuser can define a leakproof function
172+
ERROR: only superuser or mdb_admin can define a leakproof function
173173
RESET SESSION AUTHORIZATION;
174174
--
175175
-- CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT

0 commit comments

Comments
 (0)