Skip to content

Commit c4f92a5

Browse files
committed
Fix ordering of suffixification
1 parent c211a2a commit c4f92a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sql/2023-08-23-00-00_suffixification.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ BEGIN
121121
END;
122122
$$ LANGUAGE plpgsql;
123123

124-
CREATE OR REPLACE FUNCTION suffixify_term_fqn(root_bh_id integer, namespace_prefix text, mount_path text, term_name scoped_term_name_lookup)
124+
CREATE OR REPLACE FUNCTION suffixify_term_fqn(root_bh_id integer, namespace_prefix text, arg_reversed_mount_path text, term_name scoped_term_name_lookup)
125125
RETURNS text AS $$
126126
DECLARE
127127
suffixes text[];
128128
current_suffix text;
129129
fallback_suffix text := NULL;
130130
BEGIN
131-
suffixes := generate_valid_suffixifications(term_name.reversed_name || coalesce(mount_path, ''));
132-
FOR current_suffix IN SELECT unnest(suffixes)
131+
suffixes := generate_valid_suffixifications(term_name.reversed_name || coalesce(arg_reversed_mount_path, ''));
132+
FOREACH current_suffix IN ARRAY suffixes
133133
LOOP
134134
IF NOT has_name_matching_term_suffixification(root_bh_id, namespace_prefix, current_suffix, term_name)
135135
THEN
@@ -151,7 +151,7 @@ DECLARE
151151
fallback_suffix text := NULL;
152152
BEGIN
153153
suffixes := generate_valid_suffixifications(type_name.reversed_name || coalesce(mount_path, ''));
154-
FOR current_suffix IN SELECT unnest(suffixes)
154+
FOREACH current_suffix IN ARRAY suffixes
155155
LOOP
156156
IF NOT has_name_matching_type_suffixification(root_bh_id, namespace_prefix, current_suffix, type_name)
157157
THEN

0 commit comments

Comments
 (0)