Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upgrade script to resolve MVU issue from 15.11 #3465

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6719,7 +6719,7 @@ CREATE OR REPLACE VIEW information_schema_tsql.columns_internal AS
CAST(ext.orig_name AS sys.nvarchar(128)) AS "TABLE_SCHEMA",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update the search path to sys, pg_catalog, public to be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs more investigation as to why we have different search paths, will take this up later

CAST(
COALESCE(
(SELECT string_agg(
(SELECT pg_catalog.string_agg(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fix the issue. Although I think it would be better to add PG_CATALOG for all the string_agg even if it is not invoked from inside COALESCE function as that would be a good coding practice. There are such occurrences in other upgrade scripts where we call string_agg instead of PG_CATALOG.string_agg which are not invoked from inside COALESCE function. I think we should update that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, we have verified locally as well as in pre-prod upgrades and this change fixes the issue, as far as other occurences are concerned we have closely verified that either of the 2 definitions would work correctly with no differences and for prepending all such occurences there is a long list of previous such function calls which will not affect us but we can update them as a part of future changes

CASE
WHEN option LIKE 'bbf_original_rel_name=%' THEN substring(option, 23 /* prefix length */)
ELSE NULL
Expand All @@ -6730,7 +6730,7 @@ CREATE OR REPLACE VIEW information_schema_tsql.columns_internal AS

CAST(
COALESCE(
(SELECT string_agg(
(SELECT pg_catalog.string_agg(
CASE
WHEN option LIKE 'bbf_original_name=%' THEN substring(option, 19 /* prefix length */)
ELSE NULL
Expand Down Expand Up @@ -6836,7 +6836,7 @@ CREATE OR REPLACE VIEW information_schema_tsql.tables AS
CAST(ext.orig_name AS sys.nvarchar(128)) AS "TABLE_SCHEMA",
CAST(
COALESCE(
(SELECT string_agg(
(SELECT pg_catalog.string_agg(
CASE
WHEN option LIKE 'bbf_original_rel_name=%' THEN substring(option, 23)
ELSE NULL
Expand Down