Skip to content

Commit

Permalink
Add upgrade test make sure analyze is working
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 24, 2023
1 parent c9bdba3 commit b5fb8d0
Show file tree
Hide file tree
Showing 26 changed files with 159 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- 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
~~START~~
varchar
~~END~~

15 changes: 15 additions & 0 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
@@ -0,0 +1,15 @@

-- 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()
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
22 changes: 22 additions & 0 deletions test/JDBC/expected/AUTO_ANALYZE-vu-prepare.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- 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 all of the catalog has been analyzed during extension create
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
GO
~~START~~
varchar
~~END~~

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

-- 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()
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
18 changes: 18 additions & 0 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
@@ -0,0 +1,18 @@
-- 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
11 changes: 11 additions & 0 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
@@ -0,0 +1,11 @@

-- 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()
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed
GO
18 changes: 18 additions & 0 deletions test/JDBC/input/AUTO_ANALYZE-vu-prepare.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- 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 all of the catalog has been analyzed during extension create
SELECT * FROM auto_analyze_vu_prepare_catalogs_have_not_been_analyzed()
GO
11 changes: 11 additions & 0 deletions test/JDBC/input/AUTO_ANALYZE-vu-verify.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

-- 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()
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_not_been_analyzed
GO

DROP FUNCTION auto_analyze_vu_prepare_catalogs_have_been_analyzed
GO
2 changes: 2 additions & 0 deletions test/JDBC/jdbc_schedule
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ ignore#!#forjson-subquery-before-14_10-or-15_5-vu-cleanup
ignore#!#forjson-datatypes-before-14_10-or-15_5-vu-prepare
ignore#!#forjson-datatypes-before-14_10-or-15_5-vu-verify
ignore#!#forjson-datatypes-before-14_10-or-15_5-vu-cleanup
ignore#!#AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare
ignore#!#AUTO_ANALYZE-before-15-5-or-14-10-vu-verify
ignore#!#orderby-before-15_3-vu-prepare
ignore#!#orderby-before-15_3-vu-verify
ignore#!#orderby-before-15_3-vu-cleanup
Expand Down
3 changes: 2 additions & 1 deletion test/JDBC/upgrade/13_4/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,5 @@ TestXML
timefromparts
triggers_with_transaction
BABEL-4046
getdate
getdate
AUTO_ANALYZE-before-15-5-or-14-10
3 changes: 2 additions & 1 deletion test/JDBC/upgrade/13_5/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,5 @@ TestXML
timefromparts
triggers_with_transaction
BABEL-4046
getdate
getdate
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/13_6/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,4 @@ BABEL-4046
getdate
BABEL-4410
GRANT_SCHEMA
AUTO_ANALYZE-before-15-5-or-14-10
3 changes: 2 additions & 1 deletion test/JDBC/upgrade/13_7/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,5 @@ TestXML
timefromparts
triggers_with_transaction
BABEL-4046
getdate
getdate
AUTO_ANALYZE-before-15-5-or-14-10
3 changes: 2 additions & 1 deletion test/JDBC/upgrade/13_8/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,5 @@ TestXML
timefromparts
triggers_with_transaction
BABEL-4046
getdate
getdate
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/13_9/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,4 @@ BABEL-4046
getdate
BABEL-4410
GRANT_SCHEMA
AUTO_ANALYZE-before-15-5-or-14-10
3 changes: 2 additions & 1 deletion test/JDBC/upgrade/14_3/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,5 @@ BABEL-4046
BABEL_4330
BABEL-2619
BABEL-4410
GRANT_SCHEMA
GRANT_SCHEMA
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/14_5/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,4 @@ BABEL_4330
BABEL-2619
BABEL-4410
GRANT_SCHEMA
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/14_6/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,4 @@ BABEL_4330
BABEL-2619
BABEL-4410
GRANT_SCHEMA
AUTO_ANALYZE-before-15-5-or-14-10
3 changes: 2 additions & 1 deletion test/JDBC/upgrade/14_7/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,5 @@ datetimeoffset-timezone-before-15_3
BABEL-4046
getdate
BABEL_4330
BABEL-2619
BABEL-2619
AUTO_ANALYZE-before-15-5-or-14-10
3 changes: 2 additions & 1 deletion test/JDBC/upgrade/14_8/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,5 @@ datetimeoffset-timezone-before-15_3
BABEL-4046
getdate
BABEL_4330
BABEL-2619
BABEL-2619
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/14_9/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,4 @@ getdate
BABEL_4330
BABEL-2619
BABEL-4410
AUTO_ANALYZE-before-15-5-or-14-10
3 changes: 2 additions & 1 deletion test/JDBC/upgrade/15_1/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,5 @@ timefromparts
triggers_with_transaction
BABEL-4046
getdate
BABEL_4330
BABEL_4330
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/15_2/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,4 @@ getdate
BABEL_4330
BABEL-4410
GRANT_SCHEMA
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/15_3/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,4 @@ datetimeoffset-timezone
BABEL-4046
getdate
BABEL_4330
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/15_4/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,4 @@ sp_who
BABEL_4330
BABEL-4410
GRANT_SCHEMA
AUTO_ANALYZE-before-15-5-or-14-10
1 change: 1 addition & 0 deletions test/JDBC/upgrade/latest/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,4 @@ sys_certificates
sys_database_permissions
BABEL-4279
BABEL-4484
AUTO_ANALYZE

0 comments on commit b5fb8d0

Please sign in to comment.