From b5fb8d0ba38b78c1f8b7d8b84a225ef750b14d7d Mon Sep 17 00:00:00 2001 From: Sumit Jaiswal Date: Tue, 24 Oct 2023 10:48:34 +0000 Subject: [PATCH] Add upgrade test make sure analyze is working Signed-off-by: Sumit Jaiswal --- ...NALYZE-before-15-5-or-14-10-vu-prepare.out | 22 +++++++++++++++++++ ...ANALYZE-before-15-5-or-14-10-vu-verify.out | 15 +++++++++++++ .../JDBC/expected/AUTO_ANALYZE-vu-prepare.out | 22 +++++++++++++++++++ test/JDBC/expected/AUTO_ANALYZE-vu-verify.out | 15 +++++++++++++ ...NALYZE-before-15-5-or-14-10-vu-prepare.sql | 18 +++++++++++++++ ...ANALYZE-before-15-5-or-14-10-vu-verify.sql | 11 ++++++++++ test/JDBC/input/AUTO_ANALYZE-vu-prepare.sql | 18 +++++++++++++++ test/JDBC/input/AUTO_ANALYZE-vu-verify.sql | 11 ++++++++++ test/JDBC/jdbc_schedule | 2 ++ test/JDBC/upgrade/13_4/schedule | 3 ++- test/JDBC/upgrade/13_5/schedule | 3 ++- test/JDBC/upgrade/13_6/schedule | 1 + test/JDBC/upgrade/13_7/schedule | 3 ++- test/JDBC/upgrade/13_8/schedule | 3 ++- test/JDBC/upgrade/13_9/schedule | 1 + test/JDBC/upgrade/14_3/schedule | 3 ++- test/JDBC/upgrade/14_5/schedule | 1 + test/JDBC/upgrade/14_6/schedule | 1 + test/JDBC/upgrade/14_7/schedule | 3 ++- test/JDBC/upgrade/14_8/schedule | 3 ++- test/JDBC/upgrade/14_9/schedule | 1 + test/JDBC/upgrade/15_1/schedule | 3 ++- test/JDBC/upgrade/15_2/schedule | 1 + test/JDBC/upgrade/15_3/schedule | 1 + test/JDBC/upgrade/15_4/schedule | 1 + test/JDBC/upgrade/latest/schedule | 1 + 26 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.out create mode 100644 test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.out create mode 100644 test/JDBC/expected/AUTO_ANALYZE-vu-prepare.out create mode 100644 test/JDBC/expected/AUTO_ANALYZE-vu-verify.out create mode 100644 test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.sql create mode 100644 test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.sql create mode 100644 test/JDBC/input/AUTO_ANALYZE-vu-prepare.sql create mode 100644 test/JDBC/input/AUTO_ANALYZE-vu-verify.sql diff --git a/test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.out b/test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.out new file mode 100644 index 0000000000..89482eea88 --- /dev/null +++ b/test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.out @@ -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~~ + diff --git a/test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.out b/test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.out new file mode 100644 index 0000000000..2ac1bfffff --- /dev/null +++ b/test/JDBC/expected/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.out @@ -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 diff --git a/test/JDBC/expected/AUTO_ANALYZE-vu-prepare.out b/test/JDBC/expected/AUTO_ANALYZE-vu-prepare.out new file mode 100644 index 0000000000..0bae771609 --- /dev/null +++ b/test/JDBC/expected/AUTO_ANALYZE-vu-prepare.out @@ -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~~ + diff --git a/test/JDBC/expected/AUTO_ANALYZE-vu-verify.out b/test/JDBC/expected/AUTO_ANALYZE-vu-verify.out new file mode 100644 index 0000000000..2ac1bfffff --- /dev/null +++ b/test/JDBC/expected/AUTO_ANALYZE-vu-verify.out @@ -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 diff --git a/test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.sql b/test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.sql new file mode 100644 index 0000000000..df50990c5b --- /dev/null +++ b/test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-prepare.sql @@ -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 \ No newline at end of file diff --git a/test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.sql b/test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.sql new file mode 100644 index 0000000000..645821883a --- /dev/null +++ b/test/JDBC/input/AUTO_ANALYZE-before-15-5-or-14-10-vu-verify.sql @@ -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 \ No newline at end of file diff --git a/test/JDBC/input/AUTO_ANALYZE-vu-prepare.sql b/test/JDBC/input/AUTO_ANALYZE-vu-prepare.sql new file mode 100644 index 0000000000..f6330ac77b --- /dev/null +++ b/test/JDBC/input/AUTO_ANALYZE-vu-prepare.sql @@ -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 \ No newline at end of file diff --git a/test/JDBC/input/AUTO_ANALYZE-vu-verify.sql b/test/JDBC/input/AUTO_ANALYZE-vu-verify.sql new file mode 100644 index 0000000000..645821883a --- /dev/null +++ b/test/JDBC/input/AUTO_ANALYZE-vu-verify.sql @@ -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 \ No newline at end of file diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index c21361e06f..b8c10100d5 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -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 diff --git a/test/JDBC/upgrade/13_4/schedule b/test/JDBC/upgrade/13_4/schedule index ed11eb933d..6db03b7ddd 100644 --- a/test/JDBC/upgrade/13_4/schedule +++ b/test/JDBC/upgrade/13_4/schedule @@ -215,4 +215,5 @@ TestXML timefromparts triggers_with_transaction BABEL-4046 -getdate \ No newline at end of file +getdate +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/13_5/schedule b/test/JDBC/upgrade/13_5/schedule index 1e224e0b43..5b9ea6e87f 100644 --- a/test/JDBC/upgrade/13_5/schedule +++ b/test/JDBC/upgrade/13_5/schedule @@ -268,4 +268,5 @@ TestXML timefromparts triggers_with_transaction BABEL-4046 -getdate \ No newline at end of file +getdate +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/13_6/schedule b/test/JDBC/upgrade/13_6/schedule index 3943bbadbb..1ca5658967 100644 --- a/test/JDBC/upgrade/13_6/schedule +++ b/test/JDBC/upgrade/13_6/schedule @@ -325,3 +325,4 @@ BABEL-4046 getdate BABEL-4410 GRANT_SCHEMA +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/13_7/schedule b/test/JDBC/upgrade/13_7/schedule index 474e6900d4..8fa2d14a42 100644 --- a/test/JDBC/upgrade/13_7/schedule +++ b/test/JDBC/upgrade/13_7/schedule @@ -316,4 +316,5 @@ TestXML timefromparts triggers_with_transaction BABEL-4046 -getdate \ No newline at end of file +getdate +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/13_8/schedule b/test/JDBC/upgrade/13_8/schedule index 474e6900d4..8fa2d14a42 100644 --- a/test/JDBC/upgrade/13_8/schedule +++ b/test/JDBC/upgrade/13_8/schedule @@ -316,4 +316,5 @@ TestXML timefromparts triggers_with_transaction BABEL-4046 -getdate \ No newline at end of file +getdate +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/13_9/schedule b/test/JDBC/upgrade/13_9/schedule index c606176c9a..20d2d43624 100644 --- a/test/JDBC/upgrade/13_9/schedule +++ b/test/JDBC/upgrade/13_9/schedule @@ -321,3 +321,4 @@ BABEL-4046 getdate BABEL-4410 GRANT_SCHEMA +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/14_3/schedule b/test/JDBC/upgrade/14_3/schedule index f68c4e41fe..b31084b277 100644 --- a/test/JDBC/upgrade/14_3/schedule +++ b/test/JDBC/upgrade/14_3/schedule @@ -338,4 +338,5 @@ BABEL-4046 BABEL_4330 BABEL-2619 BABEL-4410 -GRANT_SCHEMA \ No newline at end of file +GRANT_SCHEMA +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/14_5/schedule b/test/JDBC/upgrade/14_5/schedule index c78b90e882..955e6bac03 100644 --- a/test/JDBC/upgrade/14_5/schedule +++ b/test/JDBC/upgrade/14_5/schedule @@ -354,3 +354,4 @@ BABEL_4330 BABEL-2619 BABEL-4410 GRANT_SCHEMA +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/14_6/schedule b/test/JDBC/upgrade/14_6/schedule index 61edb201b9..d0e3037f70 100644 --- a/test/JDBC/upgrade/14_6/schedule +++ b/test/JDBC/upgrade/14_6/schedule @@ -388,3 +388,4 @@ BABEL_4330 BABEL-2619 BABEL-4410 GRANT_SCHEMA +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/14_7/schedule b/test/JDBC/upgrade/14_7/schedule index b0fc3c87b8..2cb9c23a6c 100644 --- a/test/JDBC/upgrade/14_7/schedule +++ b/test/JDBC/upgrade/14_7/schedule @@ -407,4 +407,5 @@ datetimeoffset-timezone-before-15_3 BABEL-4046 getdate BABEL_4330 -BABEL-2619 \ No newline at end of file +BABEL-2619 +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/14_8/schedule b/test/JDBC/upgrade/14_8/schedule index b5aa90477e..23bc1e04a0 100644 --- a/test/JDBC/upgrade/14_8/schedule +++ b/test/JDBC/upgrade/14_8/schedule @@ -405,4 +405,5 @@ datetimeoffset-timezone-before-15_3 BABEL-4046 getdate BABEL_4330 -BABEL-2619 \ No newline at end of file +BABEL-2619 +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/14_9/schedule b/test/JDBC/upgrade/14_9/schedule index 356a58ce8a..2cfd289855 100644 --- a/test/JDBC/upgrade/14_9/schedule +++ b/test/JDBC/upgrade/14_9/schedule @@ -408,3 +408,4 @@ getdate BABEL_4330 BABEL-2619 BABEL-4410 +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/15_1/schedule b/test/JDBC/upgrade/15_1/schedule index abd07f86fb..cf5a232464 100644 --- a/test/JDBC/upgrade/15_1/schedule +++ b/test/JDBC/upgrade/15_1/schedule @@ -384,4 +384,5 @@ timefromparts triggers_with_transaction BABEL-4046 getdate -BABEL_4330 \ No newline at end of file +BABEL_4330 +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/15_2/schedule b/test/JDBC/upgrade/15_2/schedule index ff7db62fd1..a3d5c7cf21 100644 --- a/test/JDBC/upgrade/15_2/schedule +++ b/test/JDBC/upgrade/15_2/schedule @@ -416,3 +416,4 @@ getdate BABEL_4330 BABEL-4410 GRANT_SCHEMA +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/15_3/schedule b/test/JDBC/upgrade/15_3/schedule index e8733a81e6..357b732315 100644 --- a/test/JDBC/upgrade/15_3/schedule +++ b/test/JDBC/upgrade/15_3/schedule @@ -437,3 +437,4 @@ datetimeoffset-timezone BABEL-4046 getdate BABEL_4330 +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/15_4/schedule b/test/JDBC/upgrade/15_4/schedule index e7f12532e6..bc92072ee3 100644 --- a/test/JDBC/upgrade/15_4/schedule +++ b/test/JDBC/upgrade/15_4/schedule @@ -450,3 +450,4 @@ sp_who BABEL_4330 BABEL-4410 GRANT_SCHEMA +AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file diff --git a/test/JDBC/upgrade/latest/schedule b/test/JDBC/upgrade/latest/schedule index 8b078d6380..53ae1e447e 100644 --- a/test/JDBC/upgrade/latest/schedule +++ b/test/JDBC/upgrade/latest/schedule @@ -474,3 +474,4 @@ sys_certificates sys_database_permissions BABEL-4279 BABEL-4484 +AUTO_ANALYZE \ No newline at end of file