mirror of https://github.com/citusdata/citus.git
Prevent C-style comments in all directories (#5250)
parent
e3e0a028c7
commit
9ae912a8c8
|
@ -1,6 +1,10 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
# make ** match all directories and subdirectories
|
||||||
|
shopt -s globstar
|
||||||
|
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source ci/ci_helpers.sh
|
source ci/ci_helpers.sh
|
||||||
|
|
||||||
|
@ -12,17 +16,17 @@ source ci/ci_helpers.sh
|
||||||
# and reusing them if needed. GNU sed unfortunately does not support lookaround assertions.
|
# and reusing them if needed. GNU sed unfortunately does not support lookaround assertions.
|
||||||
|
|
||||||
# /* -> --
|
# /* -> --
|
||||||
find src/backend/distributed/sql/*.sql -print0 | xargs -0 sed -i 's#/\*#--#g'
|
find src/backend/{distributed,columnar}/sql/**/*.sql -print0 | xargs -0 sed -i 's#/\*#--#g'
|
||||||
|
|
||||||
# */ -> `` (empty string)
|
# */ -> `` (empty string)
|
||||||
# remove all whitespaces immediately before the match
|
# remove all whitespaces immediately before the match
|
||||||
find src/backend/distributed/sql/*.sql -print0 | xargs -0 sed -i 's#\s*\*/\s*##g'
|
find src/backend/{distributed,columnar}/sql/**/*.sql -print0 | xargs -0 sed -i 's#\s*\*/\s*##g'
|
||||||
|
|
||||||
# * -> --
|
# * -> --
|
||||||
# keep the indentation
|
# keep the indentation
|
||||||
# allow only whitespaces before the match
|
# allow only whitespaces before the match
|
||||||
find src/backend/distributed/sql/*.sql -print0 | xargs -0 sed -i 's#^\(\s*\) \*#\1--#g'
|
find src/backend/{distributed,columnar}/sql/**/*.sql -print0 | xargs -0 sed -i 's#^\(\s*\) \*#\1--#g'
|
||||||
|
|
||||||
# // -> --
|
# // -> --
|
||||||
# do not touch http:// or similar by allowing only whitespaces before //
|
# do not touch http:// or similar by allowing only whitespaces before //
|
||||||
find src/backend/distributed/sql/*.sql -print0 | xargs -0 sed -i 's#^\(\s*\)//#\1--#g'
|
find src/backend/{distributed,columnar}/sql/**/*.sql -print0 | xargs -0 sed -i 's#^\(\s*\)//#\1--#g'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* columnar--10.0-1--10.0-2.sql */
|
-- columnar--10.0-1--10.0-2.sql
|
||||||
|
|
||||||
-- grant read access for columnar metadata tables to unprivileged user
|
-- grant read access for columnar metadata tables to unprivileged user
|
||||||
GRANT USAGE ON SCHEMA columnar TO PUBLIC;
|
GRANT USAGE ON SCHEMA columnar TO PUBLIC;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* columnar--10.0-3--10.1-1.sql */
|
-- columnar--10.0-3--10.1-1.sql
|
||||||
|
|
||||||
-- Drop foreign keys between columnar metadata tables.
|
-- Drop foreign keys between columnar metadata tables.
|
||||||
-- Postgres assigns different names to those foreign keys in PG11, so act accordingly.
|
-- Postgres assigns different names to those foreign keys in PG11, so act accordingly.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* columnar--10.1-1--10.2-1.sql */
|
-- columnar--10.1-1--10.2-1.sql
|
||||||
|
|
||||||
-- For a proper mapping between tid & (stripe, row_num), add a new column to
|
-- For a proper mapping between tid & (stripe, row_num), add a new column to
|
||||||
-- columnar.stripe and define a BTREE index on this column.
|
-- columnar.stripe and define a BTREE index on this column.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* columnar--9.5-1--10.0-1.sql */
|
-- columnar--9.5-1--10.0-1.sql
|
||||||
|
|
||||||
CREATE SCHEMA columnar;
|
CREATE SCHEMA columnar;
|
||||||
SET search_path TO columnar;
|
SET search_path TO columnar;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* columnar--10.0-1--9.5-1.sql */
|
-- columnar--10.0-1--9.5-1.sql
|
||||||
|
|
||||||
SET search_path TO columnar;
|
SET search_path TO columnar;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* columnar--10.0-2--10.0-1.sql */
|
-- columnar--10.0-2--10.0-1.sql
|
||||||
|
|
||||||
-- revoke read access for columnar metadata tables from unprivileged user
|
-- revoke read access for columnar metadata tables from unprivileged user
|
||||||
REVOKE USAGE ON SCHEMA columnar FROM PUBLIC;
|
REVOKE USAGE ON SCHEMA columnar FROM PUBLIC;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* columnar--10.1-1--10.0-3.sql */
|
-- columnar--10.1-1--10.0-3.sql
|
||||||
|
|
||||||
-- define foreign keys between columnar metadata tables
|
-- define foreign keys between columnar metadata tables
|
||||||
ALTER TABLE columnar.chunk
|
ALTER TABLE columnar.chunk
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* columnar--10.2-1--10.1-1.sql */
|
-- columnar--10.2-1--10.1-1.sql
|
||||||
|
|
||||||
-- downgrade storage for all columnar relations
|
-- downgrade storage for all columnar relations
|
||||||
SELECT citus_internal.downgrade_columnar_storage(c.oid) FROM pg_class c, pg_am a
|
SELECT citus_internal.downgrade_columnar_storage(c.oid) FROM pg_class c, pg_am a
|
||||||
|
|
|
@ -42,7 +42,7 @@ COMMENT ON FUNCTION master_update_table_statistics(regclass)
|
||||||
IS 'updates shard statistics of the given table and its colocated tables';
|
IS 'updates shard statistics of the given table and its colocated tables';
|
||||||
|
|
||||||
DROP FUNCTION pg_catalog.citus_get_active_worker_nodes(OUT text, OUT bigint);
|
DROP FUNCTION pg_catalog.citus_get_active_worker_nodes(OUT text, OUT bigint);
|
||||||
/* copy of citus--10.0-2--10.0-1.sql */
|
-- copy of citus--10.0-2--10.0-1.sql
|
||||||
#include "../../../columnar/sql/downgrades/columnar--10.0-2--10.0-1.sql"
|
#include "../../../columnar/sql/downgrades/columnar--10.0-2--10.0-1.sql"
|
||||||
|
|
||||||
-- copy of citus--10.0-1--9.5-1
|
-- copy of citus--10.0-1--9.5-1
|
||||||
|
|
|
@ -7,7 +7,7 @@ AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
r record;
|
r record;
|
||||||
BEGIN
|
BEGIN
|
||||||
/* first check whether we can convert all the to_value's to timestamptz */
|
-- first check whether we can convert all the to_value's to timestamptz
|
||||||
BEGIN
|
BEGIN
|
||||||
PERFORM
|
PERFORM
|
||||||
FROM pg_catalog.time_partitions
|
FROM pg_catalog.time_partitions
|
||||||
|
@ -19,7 +19,7 @@ BEGIN
|
||||||
RAISE 'partition column of % cannot be cast to a timestamptz', parent_table_name;
|
RAISE 'partition column of % cannot be cast to a timestamptz', parent_table_name;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
/* now convert the partitions in separate transactions */
|
-- now convert the partitions in separate transactions
|
||||||
FOR r IN
|
FOR r IN
|
||||||
SELECT partition, from_value, to_value
|
SELECT partition, from_value, to_value
|
||||||
FROM pg_catalog.time_partitions
|
FROM pg_catalog.time_partitions
|
||||||
|
|
|
@ -7,7 +7,7 @@ AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
r record;
|
r record;
|
||||||
BEGIN
|
BEGIN
|
||||||
/* first check whether we can convert all the to_value's to timestamptz */
|
-- first check whether we can convert all the to_value's to timestamptz
|
||||||
BEGIN
|
BEGIN
|
||||||
PERFORM
|
PERFORM
|
||||||
FROM pg_catalog.time_partitions
|
FROM pg_catalog.time_partitions
|
||||||
|
@ -19,7 +19,7 @@ BEGIN
|
||||||
RAISE 'partition column of % cannot be cast to a timestamptz', parent_table_name;
|
RAISE 'partition column of % cannot be cast to a timestamptz', parent_table_name;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
/* now convert the partitions in separate transactions */
|
-- now convert the partitions in separate transactions
|
||||||
FOR r IN
|
FOR r IN
|
||||||
SELECT partition, from_value, to_value
|
SELECT partition, from_value, to_value
|
||||||
FROM pg_catalog.time_partitions
|
FROM pg_catalog.time_partitions
|
||||||
|
|
|
@ -24,16 +24,16 @@ BEGIN
|
||||||
$cmd$;
|
$cmd$;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
/*
|
--
|
||||||
* Citus creates the array_cat_agg but because of a compatibility
|
-- Citus creates the array_cat_agg but because of a compatibility
|
||||||
* issue between pg13-pg14, we drop and create it during upgrade.
|
-- issue between pg13-pg14, we drop and create it during upgrade.
|
||||||
* And as Citus creates it, there needs to be a dependency to the
|
-- And as Citus creates it, there needs to be a dependency to the
|
||||||
* Citus extension, so we create that dependency here.
|
-- Citus extension, so we create that dependency here.
|
||||||
* We are not using:
|
-- We are not using:
|
||||||
* ALTER EXENSION citus DROP/CREATE AGGREGATE array_cat_agg
|
-- ALTER EXENSION citus DROP/CREATE AGGREGATE array_cat_agg
|
||||||
* because we don't have an easy way to check if the aggregate
|
-- because we don't have an easy way to check if the aggregate
|
||||||
* exists with anyarray type or anycompatiblearray type.
|
-- exists with anyarray type or anycompatiblearray type.
|
||||||
*/
|
|
||||||
INSERT INTO pg_depend
|
INSERT INTO pg_depend
|
||||||
SELECT
|
SELECT
|
||||||
'pg_proc'::regclass::oid as classid,
|
'pg_proc'::regclass::oid as classid,
|
||||||
|
|
|
@ -24,16 +24,16 @@ BEGIN
|
||||||
$cmd$;
|
$cmd$;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
/*
|
--
|
||||||
* Citus creates the array_cat_agg but because of a compatibility
|
-- Citus creates the array_cat_agg but because of a compatibility
|
||||||
* issue between pg13-pg14, we drop and create it during upgrade.
|
-- issue between pg13-pg14, we drop and create it during upgrade.
|
||||||
* And as Citus creates it, there needs to be a dependency to the
|
-- And as Citus creates it, there needs to be a dependency to the
|
||||||
* Citus extension, so we create that dependency here.
|
-- Citus extension, so we create that dependency here.
|
||||||
* We are not using:
|
-- We are not using:
|
||||||
* ALTER EXENSION citus DROP/CREATE AGGREGATE array_cat_agg
|
-- ALTER EXENSION citus DROP/CREATE AGGREGATE array_cat_agg
|
||||||
* because we don't have an easy way to check if the aggregate
|
-- because we don't have an easy way to check if the aggregate
|
||||||
* exists with anyarray type or anycompatiblearray type.
|
-- exists with anyarray type or anycompatiblearray type.
|
||||||
*/
|
|
||||||
INSERT INTO pg_depend
|
INSERT INTO pg_depend
|
||||||
SELECT
|
SELECT
|
||||||
'pg_proc'::regclass::oid as classid,
|
'pg_proc'::regclass::oid as classid,
|
||||||
|
|
|
@ -8,13 +8,13 @@ BEGIN
|
||||||
DELETE FROM pg_depend WHERE
|
DELETE FROM pg_depend WHERE
|
||||||
objid IN (SELECT oid FROM pg_proc WHERE proname = 'array_cat_agg') AND
|
objid IN (SELECT oid FROM pg_proc WHERE proname = 'array_cat_agg') AND
|
||||||
refobjid IN (select oid from pg_extension where extname = 'citus');
|
refobjid IN (select oid from pg_extension where extname = 'citus');
|
||||||
/*
|
--
|
||||||
* We are dropping the aggregates because postgres 14 changed
|
-- We are dropping the aggregates because postgres 14 changed
|
||||||
* array_cat type from anyarray to anycompatiblearray. When
|
-- array_cat type from anyarray to anycompatiblearray. When
|
||||||
* upgrading to pg14, spegifically when running pg_restore on
|
-- upgrading to pg14, spegifically when running pg_restore on
|
||||||
* array_cat_agg we would get an error. So we drop the aggregate
|
-- array_cat_agg we would get an error. So we drop the aggregate
|
||||||
* and create the right one on citus_finish_pg_upgrade.
|
-- and create the right one on citus_finish_pg_upgrade.
|
||||||
*/
|
|
||||||
DROP AGGREGATE IF EXISTS array_cat_agg(anyarray);
|
DROP AGGREGATE IF EXISTS array_cat_agg(anyarray);
|
||||||
DROP AGGREGATE IF EXISTS array_cat_agg(anycompatiblearray);
|
DROP AGGREGATE IF EXISTS array_cat_agg(anycompatiblearray);
|
||||||
--
|
--
|
||||||
|
|
|
@ -8,13 +8,13 @@ BEGIN
|
||||||
DELETE FROM pg_depend WHERE
|
DELETE FROM pg_depend WHERE
|
||||||
objid IN (SELECT oid FROM pg_proc WHERE proname = 'array_cat_agg') AND
|
objid IN (SELECT oid FROM pg_proc WHERE proname = 'array_cat_agg') AND
|
||||||
refobjid IN (select oid from pg_extension where extname = 'citus');
|
refobjid IN (select oid from pg_extension where extname = 'citus');
|
||||||
/*
|
--
|
||||||
* We are dropping the aggregates because postgres 14 changed
|
-- We are dropping the aggregates because postgres 14 changed
|
||||||
* array_cat type from anyarray to anycompatiblearray. When
|
-- array_cat type from anyarray to anycompatiblearray. When
|
||||||
* upgrading to pg14, spegifically when running pg_restore on
|
-- upgrading to pg14, spegifically when running pg_restore on
|
||||||
* array_cat_agg we would get an error. So we drop the aggregate
|
-- array_cat_agg we would get an error. So we drop the aggregate
|
||||||
* and create the right one on citus_finish_pg_upgrade.
|
-- and create the right one on citus_finish_pg_upgrade.
|
||||||
*/
|
|
||||||
DROP AGGREGATE IF EXISTS array_cat_agg(anyarray);
|
DROP AGGREGATE IF EXISTS array_cat_agg(anyarray);
|
||||||
DROP AGGREGATE IF EXISTS array_cat_agg(anycompatiblearray);
|
DROP AGGREGATE IF EXISTS array_cat_agg(anycompatiblearray);
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in New Issue