Skip to content

Commit

Permalink
Remove functions from test file
Browse files Browse the repository at this point in the history
Signed-off-by: Sumit Jaiswal <[email protected]>
  • Loading branch information
Sumit Jaiswal committed Oct 25, 2023
1 parent 77c9e13 commit 03cd14a
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 93 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
-- function to list all the babelfish catalogs that has not been analyzed manually
CREATE FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
RETURNS TABLE
AS RETURN
(SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL)
GO

-- function to list all the babelfish catalogs that has been analyzed manually
CREATE FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed()
RETURNS TABLE
AS RETURN
(SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL)
GO


-- will return null as none of the catalog has been analyzed
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_been_analyzed()
GO
-- list all the babel catalogs that has been analyzed manually during extension create
-- will return NULL in this case
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL order by relname
Go
~~START~~
varchar
~~END~~
Expand Down
34 changes: 27 additions & 7 deletions test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.out
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@

-- list all the babelfish catalogs that has not been analyzed manually after upgrade
-- will return null
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
-- list all the babel catalogs that has not been analyzed manually during extension upgrade
-- will return NULL in this case
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL order by relname
GO
~~START~~
varchar
~~END~~


DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed
GO
-- list all the babel catalogs that has been analyzed manually during extension upgrade
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL order by relname
Go
~~START~~
varchar
assemblies
babelfish_authid_login_ext
babelfish_authid_user_ext
babelfish_configurations
babelfish_domain_mapping
babelfish_extended_properties
babelfish_function_ext
babelfish_helpcollation
babelfish_namespace_ext
babelfish_schema_permissions
babelfish_server_options
babelfish_sysdatabases
babelfish_syslanguages
babelfish_view_def
service_settings
spt_datatype_info_table
versions
~~END~~

42 changes: 27 additions & 15 deletions test/JDBC/expected/AUTO_ANALYZE-vu-prepare.out
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
-- function to list all the babelfish catalogs that has not been analyzed manually
CREATE FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
RETURNS TABLE
AS RETURN
(SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL)
GO

-- function to list all the babelfish catalogs that has been analyzed manually
CREATE FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed()
RETURNS TABLE
AS RETURN
(SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL)
GO
-- list all the babel catalogs that has not been analyzed manually during extension create
-- will return NULL in this case
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL order by relname
Go
~~START~~
varchar
~~END~~


-- will return null as all of the catalog has been analyzed during extension create
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
GO
-- list all the babel catalogs that has been analyzed manually during extension create
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL order by relname
Go
~~START~~
varchar
assemblies
babelfish_authid_login_ext
babelfish_authid_user_ext
babelfish_configurations
babelfish_domain_mapping
babelfish_extended_properties
babelfish_function_ext
babelfish_helpcollation
babelfish_namespace_ext
babelfish_schema_permissions
babelfish_server_options
babelfish_sysdatabases
babelfish_syslanguages
babelfish_view_def
service_settings
spt_datatype_info_table
versions
~~END~~

34 changes: 27 additions & 7 deletions test/JDBC/expected/AUTO_ANALYZE-vu-verify.out
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@

-- list all the babelfish catalogs that has not been analyzed manually after upgrade
-- will return null
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
-- list all the babel catalogs that has not been analyzed manually during extension upgrade
-- will return NULL in this case
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL order by relname
GO
~~START~~
varchar
~~END~~


DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed
GO
-- list all the babel catalogs that has been analyzed manually during extension upgrade
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL order by relname
Go
~~START~~
varchar
assemblies
babelfish_authid_login_ext
babelfish_authid_user_ext
babelfish_configurations
babelfish_domain_mapping
babelfish_extended_properties
babelfish_function_ext
babelfish_helpcollation
babelfish_namespace_ext
babelfish_schema_permissions
babelfish_server_options
babelfish_sysdatabases
babelfish_syslanguages
babelfish_view_def
service_settings
spt_datatype_info_table
versions
~~END~~

21 changes: 4 additions & 17 deletions test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.sql
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
-- function to list all the babelfish catalogs that has not been analyzed manually
CREATE FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
RETURNS TABLE
AS RETURN
(SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL)
GO

-- function to list all the babelfish catalogs that has been analyzed manually
CREATE FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed()
RETURNS TABLE
AS RETURN
(SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL)
GO


-- will return null as none of the catalog has been analyzed
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_been_analyzed()
GO
-- list all the babel catalogs that has been analyzed manually during extension create
-- will return NULL in this case
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL order by relname
Go
13 changes: 6 additions & 7 deletions test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

-- list all the babelfish catalogs that has not been analyzed manually after upgrade
-- will return null
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
-- list all the babel catalogs that has not been analyzed manually during extension upgrade
-- will return NULL in this case
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL order by relname
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed
GO
-- list all the babel catalogs that has been analyzed manually during extension upgrade
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL order by relname
Go
23 changes: 7 additions & 16 deletions test/JDBC/input/AUTO_ANALYZE-vu-prepare.sql
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
-- function to list all the babelfish catalogs that has not been analyzed manually
CREATE FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
RETURNS TABLE
AS RETURN
(SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL)
GO

-- function to list all the babelfish catalogs that has been analyzed manually
CREATE FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed()
RETURNS TABLE
AS RETURN
(SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL)
GO
-- list all the babel catalogs that has not been analyzed manually during extension create
-- will return NULL in this case
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL order by relname
Go


-- will return null as all of the catalog has been analyzed during extension create
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
GO
-- list all the babel catalogs that has been analyzed manually during extension create
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL order by relname
Go
13 changes: 6 additions & 7 deletions test/JDBC/input/AUTO_ANALYZE-vu-verify.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

-- list all the babelfish catalogs that has not been analyzed manually after upgrade
-- will return null
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
-- list all the babel catalogs that has not been analyzed manually during extension upgrade
-- will return NULL in this case
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NULL order by relname
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed
GO
-- list all the babel catalogs that has been analyzed manually during extension upgrade
SELECT relname FROM pg_stat_all_tables WHERE schemaname = 'sys' and last_analyze IS NOT NULL order by relname
Go

0 comments on commit 03cd14a

Please sign in to comment.