Merge branch 'release-13.1' into release-13.1-alperkocatas

pull/8006/head
Onur Tirtir 2025-06-02 10:48:25 +03:00 committed by GitHub
commit ec617b872d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 100 additions and 14 deletions

18
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for Citus 13.1devel. # Generated by GNU Autoconf 2.69 for Citus 13.1.0.
# #
# #
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='Citus' PACKAGE_NAME='Citus'
PACKAGE_TARNAME='citus' PACKAGE_TARNAME='citus'
PACKAGE_VERSION='13.1devel' PACKAGE_VERSION='13.1.0'
PACKAGE_STRING='Citus 13.1devel' PACKAGE_STRING='Citus 13.1.0'
PACKAGE_BUGREPORT='' PACKAGE_BUGREPORT=''
PACKAGE_URL='' PACKAGE_URL=''
@ -1262,7 +1262,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures Citus 13.1devel to adapt to many kinds of systems. \`configure' configures Citus 13.1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1324,7 +1324,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of Citus 13.1devel:";; short | recursive ) echo "Configuration of Citus 13.1.0:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1429,7 +1429,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
Citus configure 13.1devel Citus configure 13.1.0
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
@ -1912,7 +1912,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by Citus $as_me 13.1devel, which was It was created by Citus $as_me 13.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@ -5393,7 +5393,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by Citus $as_me 13.1devel, which was This file was extended by Citus $as_me 13.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -5455,7 +5455,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
Citus config.status 13.1devel Citus config.status 13.1.0
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@ -5,7 +5,7 @@
# everyone needing autoconf installed, the resulting files are checked # everyone needing autoconf installed, the resulting files are checked
# into the SCM. # into the SCM.
AC_INIT([Citus], [13.1devel]) AC_INIT([Citus], [13.1.0])
AC_COPYRIGHT([Copyright (c) Citus Data, Inc.]) AC_COPYRIGHT([Copyright (c) Citus Data, Inc.])
# we'll need sed and awk for some of the version commands # we'll need sed and awk for some of the version commands

View File

@ -962,6 +962,7 @@ shard_name(PG_FUNCTION_ARGS)
Oid relationId = PG_GETARG_OID(0); Oid relationId = PG_GETARG_OID(0);
int64 shardId = PG_GETARG_INT64(1); int64 shardId = PG_GETARG_INT64(1);
bool skipQualifyPublic = PG_GETARG_BOOL(2);
char *qualifiedName = NULL; char *qualifiedName = NULL;
@ -991,7 +992,7 @@ shard_name(PG_FUNCTION_ARGS)
Oid schemaId = get_rel_namespace(relationId); Oid schemaId = get_rel_namespace(relationId);
char *schemaName = get_namespace_name(schemaId); char *schemaName = get_namespace_name(schemaId);
if (strncmp(schemaName, "public", NAMEDATALEN) == 0) if (skipQualifyPublic && strncmp(schemaName, "public", NAMEDATALEN) == 0)
{ {
qualifiedName = (char *) quote_identifier(relationName); qualifiedName = (char *) quote_identifier(relationName);
} }

View File

@ -51,3 +51,10 @@ DROP VIEW IF EXISTS pg_catalog.citus_lock_waits;
#include "udfs/citus_stat_counters/13.1-1.sql" #include "udfs/citus_stat_counters/13.1-1.sql"
#include "udfs/citus_stat_counters_reset/13.1-1.sql" #include "udfs/citus_stat_counters_reset/13.1-1.sql"
#include "udfs/citus_nodes/13.1-1.sql" #include "udfs/citus_nodes/13.1-1.sql"
-- Since shard_name/13.1-1.sql first drops the function and then creates it, we first
-- need to drop citus_shards view since that view depends on this function. And immediately
-- after creating the function, we recreate citus_shards view again.
DROP VIEW pg_catalog.citus_shards;
#include "udfs/shard_name/13.1-1.sql"
#include "udfs/citus_shards/12.0-1.sql"

View File

@ -46,3 +46,24 @@ DROP VIEW pg_catalog.citus_stat_counters;
DROP FUNCTION pg_catalog.citus_stat_counters(oid); DROP FUNCTION pg_catalog.citus_stat_counters(oid);
DROP FUNCTION pg_catalog.citus_stat_counters_reset(oid); DROP FUNCTION pg_catalog.citus_stat_counters_reset(oid);
DROP VIEW IF EXISTS pg_catalog.citus_nodes; DROP VIEW IF EXISTS pg_catalog.citus_nodes;
-- Definition of shard_name() prior to this release doesn't have a separate SQL file
-- because it's quite an old UDF that its prior definition(s) was(were) squashed into
-- citus--8.0-1.sql. For this reason, to downgrade it, here we directly execute its old
-- definition instead of including it from such a separate file.
--
-- And before dropping and creating the function, we also need to drop citus_shards view
-- since it depends on it. And immediately after creating the function, we recreate
-- citus_shards view again.
DROP VIEW pg_catalog.citus_shards;
DROP FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint, skip_qualify_public boolean);
CREATE FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint)
RETURNS text
LANGUAGE C STABLE STRICT
AS 'MODULE_PATHNAME', $$shard_name$$;
COMMENT ON FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint)
IS 'returns schema-qualified, shard-extended identifier of object name';
#include "../udfs/citus_shards/12.0-1.sql"

View File

@ -0,0 +1,8 @@
-- skip_qualify_public is set to true by default just for backward compatibility
DROP FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint);
CREATE FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint, skip_qualify_public boolean DEFAULT true)
RETURNS text
LANGUAGE C STABLE STRICT
AS 'MODULE_PATHNAME', $$shard_name$$;
COMMENT ON FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint, skip_qualify_public boolean)
IS 'returns schema-qualified, shard-extended identifier of object name';

View File

@ -0,0 +1,8 @@
-- skip_qualify_public is set to true by default just for backward compatibility
DROP FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint);
CREATE FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint, skip_qualify_public boolean DEFAULT true)
RETURNS text
LANGUAGE C STABLE STRICT
AS 'MODULE_PATHNAME', $$shard_name$$;
COMMENT ON FUNCTION pg_catalog.shard_name(object_name regclass, shard_id bigint, skip_qualify_public boolean)
IS 'returns schema-qualified, shard-extended identifier of object name';

View File

@ -33,5 +33,33 @@ SELECT * FROM citus_shards;
t1 | 99456903 | citus_shards.t1_99456903 | distributed | 456900 | localhost | 57638 | 8192 t1 | 99456903 | citus_shards.t1_99456903 | distributed | 456900 | localhost | 57638 | 8192
(8 rows) (8 rows)
SET search_path TO public;
CREATE TABLE t3 (i int);
SELECT citus_add_local_table_to_metadata('t3');
citus_add_local_table_to_metadata
---------------------------------------------------------------------
(1 row)
SELECT shard_name('t3', shardid) FROM pg_dist_shard WHERE logicalrelid = 't3'::regclass;
shard_name
---------------------------------------------------------------------
t3_99456908
(1 row)
SELECT shard_name('t3', shardid, true) FROM pg_dist_shard WHERE logicalrelid = 't3'::regclass;
shard_name
---------------------------------------------------------------------
t3_99456908
(1 row)
SELECT shard_name('t3', shardid, false) FROM pg_dist_shard WHERE logicalrelid = 't3'::regclass;
shard_name
---------------------------------------------------------------------
public.t3_99456908
(1 row)
DROP TABLE t3;
SET search_path TO citus_shards;
SET client_min_messages TO WARNING; SET client_min_messages TO WARNING;
DROP SCHEMA citus_shards CASCADE; DROP SCHEMA citus_shards CASCADE;

View File

@ -1455,6 +1455,7 @@ SELECT * FROM multi_extension.print_extension_changes();
previous_object | current_object previous_object | current_object
--------------------------------------------------------------------- ---------------------------------------------------------------------
function citus_unmark_object_distributed(oid,oid,integer) void | function citus_unmark_object_distributed(oid,oid,integer) void |
function shard_name(regclass,bigint) text |
| function citus_internal.acquire_citus_advisory_object_class_lock(integer,cstring) void | function citus_internal.acquire_citus_advisory_object_class_lock(integer,cstring) void
| function citus_internal.add_colocation_metadata(integer,integer,integer,regtype,oid) void | function citus_internal.add_colocation_metadata(integer,integer,integer,regtype,oid) void
| function citus_internal.add_object_metadata(text,text[],text[],integer,integer,boolean) void | function citus_internal.add_object_metadata(text,text[],text[],integer,integer,boolean) void
@ -1483,16 +1484,17 @@ SELECT * FROM multi_extension.print_extension_changes();
| function citus_stat_counters(oid) SETOF record | function citus_stat_counters(oid) SETOF record
| function citus_stat_counters_reset(oid) void | function citus_stat_counters_reset(oid) void
| function citus_unmark_object_distributed(oid,oid,integer,boolean) void | function citus_unmark_object_distributed(oid,oid,integer,boolean) void
| function shard_name(regclass,bigint,boolean) text
| view citus_nodes | view citus_nodes
| view citus_stat_counters | view citus_stat_counters
(31 rows) (33 rows)
DROP TABLE multi_extension.prev_objects, multi_extension.extension_diff; DROP TABLE multi_extension.prev_objects, multi_extension.extension_diff;
-- show running version -- show running version
SHOW citus.version; SHOW citus.version;
citus.version citus.version
--------------------------------------------------------------------- ---------------------------------------------------------------------
13.1devel 13.1.0
(1 row) (1 row)
-- ensure no unexpected objects were created outside pg_catalog -- ensure no unexpected objects were created outside pg_catalog

View File

@ -289,7 +289,7 @@ ORDER BY 1;
function run_command_on_placements(regclass,text,boolean) function run_command_on_placements(regclass,text,boolean)
function run_command_on_shards(regclass,text,boolean) function run_command_on_shards(regclass,text,boolean)
function run_command_on_workers(text,boolean) function run_command_on_workers(text,boolean)
function shard_name(regclass,bigint) function shard_name(regclass,bigint,boolean)
function start_metadata_sync_to_all_nodes() function start_metadata_sync_to_all_nodes()
function start_metadata_sync_to_node(text,integer) function start_metadata_sync_to_node(text,integer)
function stop_metadata_sync_to_node(text,integer,boolean) function stop_metadata_sync_to_node(text,integer,boolean)

View File

@ -13,5 +13,16 @@ INSERT INTO t1 SELECT generate_series(1, 100);
INSERT INTO "t with space" SELECT generate_series(1, 1000); INSERT INTO "t with space" SELECT generate_series(1, 1000);
SELECT * FROM citus_shards; SELECT * FROM citus_shards;
SET search_path TO public;
CREATE TABLE t3 (i int);
SELECT citus_add_local_table_to_metadata('t3');
SELECT shard_name('t3', shardid) FROM pg_dist_shard WHERE logicalrelid = 't3'::regclass;
SELECT shard_name('t3', shardid, true) FROM pg_dist_shard WHERE logicalrelid = 't3'::regclass;
SELECT shard_name('t3', shardid, false) FROM pg_dist_shard WHERE logicalrelid = 't3'::regclass;
DROP TABLE t3;
SET search_path TO citus_shards;
SET client_min_messages TO WARNING; SET client_min_messages TO WARNING;
DROP SCHEMA citus_shards CASCADE; DROP SCHEMA citus_shards CASCADE;