From 2460c52b51e1b46c5354ca4c87eb6ee223a13d96 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Mon, 22 Jul 2024 21:23:25 +0200 Subject: [PATCH 1/8] Add MySQL 8.4 unit tests Signed-off-by: Dirkjan Bussink --- .github/workflows/cluster_endtoend_12.yml | 2 +- .github/workflows/cluster_endtoend_13.yml | 2 +- .github/workflows/cluster_endtoend_15.yml | 2 +- .github/workflows/cluster_endtoend_18.yml | 2 +- .github/workflows/cluster_endtoend_21.yml | 2 +- .../cluster_endtoend_backup_pitr.yml | 2 +- ...ter_endtoend_ers_prs_newfeatures_heavy.yml | 2 +- .../workflows/cluster_endtoend_mysql80.yml | 2 +- .../cluster_endtoend_mysql_server_vault.yml | 2 +- .../cluster_endtoend_onlineddl_revert.yml | 2 +- .../cluster_endtoend_onlineddl_scheduler.yml | 2 +- .../cluster_endtoend_onlineddl_vrepl.yml | 2 +- ...luster_endtoend_onlineddl_vrepl_stress.yml | 2 +- ..._endtoend_onlineddl_vrepl_stress_suite.yml | 2 +- ...cluster_endtoend_onlineddl_vrepl_suite.yml | 2 +- .../cluster_endtoend_schemadiff_vrepl.yml | 2 +- .../cluster_endtoend_tabletmanager_consul.yml | 2 +- ...cluster_endtoend_tabletmanager_tablegc.yml | 2 +- ..._endtoend_tabletmanager_throttler_topo.yml | 2 +- ...cluster_endtoend_topo_connection_cache.yml | 2 +- ...dtoend_vreplication_across_db_versions.yml | 2 +- .../cluster_endtoend_vreplication_basic.yml | 2 +- ...luster_endtoend_vreplication_cellalias.yml | 2 +- ...er_endtoend_vreplication_copy_parallel.yml | 2 +- ...dtoend_vreplication_foreign_key_stress.yml | 2 +- ...endtoend_vreplication_mariadb_to_mysql.yml | 2 +- ...vreplication_migrate_vdiff2_convert_tz.yml | 2 +- ...ter_endtoend_vreplication_multi_tenant.yml | 2 +- ...ion_partial_movetables_and_materialize.yml | 2 +- .../cluster_endtoend_vreplication_v2.yml | 2 +- .../workflows/cluster_endtoend_vstream.yml | 2 +- .../workflows/cluster_endtoend_vtbackup.yml | 2 +- ..._vtctlbackup_sharded_clustertest_heavy.yml | 2 +- .../cluster_endtoend_vtgate_concurrentdml.yml | 2 +- ...ster_endtoend_vtgate_foreignkey_stress.yml | 2 +- .../cluster_endtoend_vtgate_gen4.yml | 2 +- .../cluster_endtoend_vtgate_general_heavy.yml | 2 +- .../cluster_endtoend_vtgate_godriver.yml | 2 +- ...uster_endtoend_vtgate_partial_keyspace.yml | 2 +- .../cluster_endtoend_vtgate_queries.yml | 2 +- ...cluster_endtoend_vtgate_readafterwrite.yml | 2 +- .../cluster_endtoend_vtgate_reservedconn.yml | 2 +- .../cluster_endtoend_vtgate_schema.yml | 2 +- ...cluster_endtoend_vtgate_schema_tracker.yml | 2 +- ...dtoend_vtgate_tablet_healthcheck_cache.yml | 2 +- .../cluster_endtoend_vtgate_topo.yml | 2 +- .../cluster_endtoend_vtgate_topo_consul.yml | 2 +- .../cluster_endtoend_vtgate_topo_etcd.yml | 2 +- .../cluster_endtoend_vtgate_transaction.yml | 2 +- .../cluster_endtoend_vtgate_unsharded.yml | 2 +- .../cluster_endtoend_vtgate_vindex_heavy.yml | 2 +- .../cluster_endtoend_vtgate_vschema.yml | 2 +- .github/workflows/cluster_endtoend_vtorc.yml | 2 +- .../cluster_endtoend_vttablet_prscomplex.yml | 2 +- .github/workflows/codeql_analysis.yml | 2 +- .github/workflows/e2e_race.yml | 2 +- .github/workflows/local_example.yml | 2 +- .github/workflows/region_example.yml | 2 +- .../unit_test_evalengine_mysql57.yml | 5 +- .../unit_test_evalengine_mysql80.yml | 5 +- .../unit_test_evalengine_mysql84.yml | 175 ++++++++++++++++++ .github/workflows/unit_test_mysql57.yml | 5 +- .github/workflows/unit_test_mysql80.yml | 5 +- .github/workflows/unit_test_mysql84.yml | 175 ++++++++++++++++++ .../upgrade_downgrade_test_backups_manual.yml | 2 +- ...grade_test_backups_manual_next_release.yml | 2 +- .../upgrade_downgrade_test_onlineddl_flow.yml | 2 +- ...e_downgrade_test_query_serving_queries.yml | 2 +- ...est_query_serving_queries_next_release.yml | 2 +- ...de_downgrade_test_query_serving_schema.yml | 2 +- ...test_query_serving_schema_next_release.yml | 2 +- ...rade_downgrade_test_reparent_new_vtctl.yml | 2 +- ...e_downgrade_test_reparent_new_vttablet.yml | 2 +- ...rade_downgrade_test_reparent_old_vtctl.yml | 2 +- ...e_downgrade_test_reparent_old_vttablet.yml | 2 +- .github/workflows/vitess_tester_vtgate.yml | 2 +- test/ci_workflow_gen.go | 3 +- test/templates/cluster_endtoend_test.tpl | 2 +- .../cluster_endtoend_test_mysql57.tpl | 2 +- test/templates/cluster_vitess_tester.tpl | 2 +- test/templates/unit_test.tpl | 17 +- 81 files changed, 441 insertions(+), 95 deletions(-) create mode 100644 .github/workflows/unit_test_evalengine_mysql84.yml create mode 100644 .github/workflows/unit_test_mysql84.yml diff --git a/.github/workflows/cluster_endtoend_12.yml b/.github/workflows/cluster_endtoend_12.yml index 9bbef78eeb8..3c984f4d403 100644 --- a/.github/workflows/cluster_endtoend_12.yml +++ b/.github/workflows/cluster_endtoend_12.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_13.yml b/.github/workflows/cluster_endtoend_13.yml index f26195f49e5..c1a92a8a4b7 100644 --- a/.github/workflows/cluster_endtoend_13.yml +++ b/.github/workflows/cluster_endtoend_13.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_15.yml b/.github/workflows/cluster_endtoend_15.yml index cae2e55e669..3d2881b7676 100644 --- a/.github/workflows/cluster_endtoend_15.yml +++ b/.github/workflows/cluster_endtoend_15.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_18.yml b/.github/workflows/cluster_endtoend_18.yml index bcac80cf804..1f35fbf0431 100644 --- a/.github/workflows/cluster_endtoend_18.yml +++ b/.github/workflows/cluster_endtoend_18.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_21.yml b/.github/workflows/cluster_endtoend_21.yml index 9434a280829..d47ad86dfd1 100644 --- a/.github/workflows/cluster_endtoend_21.yml +++ b/.github/workflows/cluster_endtoend_21.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_backup_pitr.yml b/.github/workflows/cluster_endtoend_backup_pitr.yml index 8a562120fdb..560b3029158 100644 --- a/.github/workflows/cluster_endtoend_backup_pitr.yml +++ b/.github/workflows/cluster_endtoend_backup_pitr.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml index 1d1627463b1..a3f41d78264 100644 --- a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml +++ b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_mysql80.yml b/.github/workflows/cluster_endtoend_mysql80.yml index 8c2f3e4dd80..f5dc2abad55 100644 --- a/.github/workflows/cluster_endtoend_mysql80.yml +++ b/.github/workflows/cluster_endtoend_mysql80.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_mysql_server_vault.yml b/.github/workflows/cluster_endtoend_mysql_server_vault.yml index 48a4c5c1897..d41b6f014f5 100644 --- a/.github/workflows/cluster_endtoend_mysql_server_vault.yml +++ b/.github/workflows/cluster_endtoend_mysql_server_vault.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert.yml b/.github/workflows/cluster_endtoend_onlineddl_revert.yml index d48f9919055..10e6c4e670f 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert.yml @@ -97,7 +97,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml index bf06949472a..4b76d62b923 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml @@ -97,7 +97,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml index c920d49cbd3..f2e7d2939f0 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml @@ -97,7 +97,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml index f58e9239bcb..7574a4bcea2 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml @@ -97,7 +97,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml index 7a30bd2c476..c6576ed2927 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml @@ -97,7 +97,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml index f1ba097e3f9..ce528f797ea 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml @@ -97,7 +97,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml index 0a239092a2f..07224c415db 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml @@ -97,7 +97,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml index 27b72d07b9e..e80c8598f44 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml index 90c07975836..14973bd1f2d 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml b/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml index f2643f2060c..a647e443e61 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_topo_connection_cache.yml b/.github/workflows/cluster_endtoend_topo_connection_cache.yml index 80883fb70d1..37c932621d9 100644 --- a/.github/workflows/cluster_endtoend_topo_connection_cache.yml +++ b/.github/workflows/cluster_endtoend_topo_connection_cache.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml index 79a154c2ead..9116e1d3fc2 100644 --- a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml +++ b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_basic.yml b/.github/workflows/cluster_endtoend_vreplication_basic.yml index 9af84e462c9..7843ad05192 100644 --- a/.github/workflows/cluster_endtoend_vreplication_basic.yml +++ b/.github/workflows/cluster_endtoend_vreplication_basic.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml index 3180f0ea723..9a179229f1e 100644 --- a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml +++ b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_copy_parallel.yml b/.github/workflows/cluster_endtoend_vreplication_copy_parallel.yml index b52e0cb433b..37eafd948c4 100644 --- a/.github/workflows/cluster_endtoend_vreplication_copy_parallel.yml +++ b/.github/workflows/cluster_endtoend_vreplication_copy_parallel.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml b/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml index 26e670c3d08..9fb4287e0b1 100644 --- a/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml +++ b/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_mariadb_to_mysql.yml b/.github/workflows/cluster_endtoend_vreplication_mariadb_to_mysql.yml index ab8ea8b7264..86f2fa69e30 100644 --- a/.github/workflows/cluster_endtoend_vreplication_mariadb_to_mysql.yml +++ b/.github/workflows/cluster_endtoend_vreplication_mariadb_to_mysql.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml index 924a45aa439..d7d385f1e9f 100644 --- a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml +++ b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_multi_tenant.yml b/.github/workflows/cluster_endtoend_vreplication_multi_tenant.yml index 35270501b38..e4e5ee17452 100644 --- a/.github/workflows/cluster_endtoend_vreplication_multi_tenant.yml +++ b/.github/workflows/cluster_endtoend_vreplication_multi_tenant.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml index d93a59e2d50..a7b2c31b420 100644 --- a/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml +++ b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vreplication_v2.yml b/.github/workflows/cluster_endtoend_vreplication_v2.yml index 65a3d58b2a0..fb1247fabfb 100644 --- a/.github/workflows/cluster_endtoend_vreplication_v2.yml +++ b/.github/workflows/cluster_endtoend_vreplication_v2.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vstream.yml b/.github/workflows/cluster_endtoend_vstream.yml index 74ef2e73b86..5d13e6d3a41 100644 --- a/.github/workflows/cluster_endtoend_vstream.yml +++ b/.github/workflows/cluster_endtoend_vstream.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtbackup.yml b/.github/workflows/cluster_endtoend_vtbackup.yml index c95fe428092..9bf411cc328 100644 --- a/.github/workflows/cluster_endtoend_vtbackup.yml +++ b/.github/workflows/cluster_endtoend_vtbackup.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml index 72fd1c652eb..09fbfa8e451 100644 --- a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml index 374ac97a4d7..b8cb2d77ad9 100644 --- a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml +++ b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml b/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml index 7f2c2f6e9ba..5ad1025debd 100644 --- a/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml +++ b/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_gen4.yml b/.github/workflows/cluster_endtoend_vtgate_gen4.yml index 5890970519f..43bbe666186 100644 --- a/.github/workflows/cluster_endtoend_vtgate_gen4.yml +++ b/.github/workflows/cluster_endtoend_vtgate_gen4.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml index 6ac03c17e81..d63edf72ae7 100644 --- a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_godriver.yml b/.github/workflows/cluster_endtoend_vtgate_godriver.yml index 9eba657c65d..c7c2d0bf494 100644 --- a/.github/workflows/cluster_endtoend_vtgate_godriver.yml +++ b/.github/workflows/cluster_endtoend_vtgate_godriver.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml b/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml index 9600c48486f..3510e8f2144 100644 --- a/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml +++ b/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_queries.yml b/.github/workflows/cluster_endtoend_vtgate_queries.yml index dcc10cb9b4a..40f20e2177e 100644 --- a/.github/workflows/cluster_endtoend_vtgate_queries.yml +++ b/.github/workflows/cluster_endtoend_vtgate_queries.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml index 8d95830e276..c913e05810a 100644 --- a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml +++ b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml index ad95087a8f3..aa173b32ca3 100644 --- a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml +++ b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_schema.yml b/.github/workflows/cluster_endtoend_vtgate_schema.yml index a3b79c0b8d0..5a5ab725b8a 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml index 50a044c4bc2..00244b8223a 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml index 007289158ac..ee14848cd79 100644 --- a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml +++ b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_topo.yml b/.github/workflows/cluster_endtoend_vtgate_topo.yml index 2384d8e6021..9517ad965b5 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml index 906f9aa04d8..6d585fb41f3 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml index 64861ef358a..d1ae0e96afd 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_transaction.yml b/.github/workflows/cluster_endtoend_vtgate_transaction.yml index 41a84f42d3f..3cb01779437 100644 --- a/.github/workflows/cluster_endtoend_vtgate_transaction.yml +++ b/.github/workflows/cluster_endtoend_vtgate_transaction.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml index a879e88ba44..b0d8348aaab 100644 --- a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml +++ b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml index 964146c9829..330ee506517 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtgate_vschema.yml b/.github/workflows/cluster_endtoend_vtgate_vschema.yml index c66c9959ab2..4ddf20fa9c5 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vschema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vschema.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vtorc.yml b/.github/workflows/cluster_endtoend_vtorc.yml index d6fb811f533..77493692395 100644 --- a/.github/workflows/cluster_endtoend_vtorc.yml +++ b/.github/workflows/cluster_endtoend_vtorc.yml @@ -105,7 +105,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml b/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml index 248a611a864..58ff4074c0c 100644 --- a/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml +++ b/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml @@ -96,7 +96,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/.github/workflows/codeql_analysis.yml b/.github/workflows/codeql_analysis.yml index 154ce0fa822..d6d5ea6335d 100644 --- a/.github/workflows/codeql_analysis.yml +++ b/.github/workflows/codeql_analysis.yml @@ -59,7 +59,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/e2e_race.yml b/.github/workflows/e2e_race.yml index cef0ea4d583..7819ab3ae90 100644 --- a/.github/workflows/e2e_race.yml +++ b/.github/workflows/e2e_race.yml @@ -65,7 +65,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/local_example.yml b/.github/workflows/local_example.yml index 78cd2d1784f..851db91df22 100644 --- a/.github/workflows/local_example.yml +++ b/.github/workflows/local_example.yml @@ -71,7 +71,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/region_example.yml b/.github/workflows/region_example.yml index fa08d3d80cb..b10abe415d7 100644 --- a/.github/workflows/region_example.yml +++ b/.github/workflows/region_example.yml @@ -71,7 +71,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/unit_test_evalengine_mysql57.yml b/.github/workflows/unit_test_evalengine_mysql57.yml index 7ab842835fb..313e076177c 100644 --- a/.github/workflows/unit_test_evalengine_mysql57.yml +++ b/.github/workflows/unit_test_evalengine_mysql57.yml @@ -102,9 +102,8 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb - # mysql57 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb # Bionic packages are still compatible for Jammy since there's no MySQL 5.7 # packages for Jammy. echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections @@ -112,7 +111,7 @@ jobs: sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 - + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata sudo service mysql stop sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 diff --git a/.github/workflows/unit_test_evalengine_mysql80.yml b/.github/workflows/unit_test_evalengine_mysql80.yml index f5c127a8b77..a19087f6f29 100644 --- a/.github/workflows/unit_test_evalengine_mysql80.yml +++ b/.github/workflows/unit_test_evalengine_mysql80.yml @@ -102,14 +102,13 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb - # mysql80 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-server mysql-client - + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata sudo service mysql stop sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 diff --git a/.github/workflows/unit_test_evalengine_mysql84.yml b/.github/workflows/unit_test_evalengine_mysql84.yml new file mode 100644 index 00000000000..be066cc5bb1 --- /dev/null +++ b/.github/workflows/unit_test_evalengine_mysql84.yml @@ -0,0 +1,175 @@ +# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" + +name: Unit Test (evalengine_mysql84) +on: [push, pull_request] +concurrency: + group: format('{0}-{1}', ${{ github.ref }}, 'Unit Test (evalengine_mysql84)') + cancel-in-progress: true + +permissions: read-all + +env: + LAUNCHABLE_ORGANIZATION: "vitess" + LAUNCHABLE_WORKSPACE: "vitess-app" + GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}" + +jobs: + test: + name: Unit Test (evalengine_mysql84) + runs-on: gh-hosted-runners-4cores-1 + + steps: + - name: Skip CI + run: | + if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then + echo "skipping CI due to the 'Skip CI' label" + exit 1 + fi + + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT + + PR_DATA=$(curl \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") + draft=$(echo "$PR_DATA" | jq .draft -r) + echo "is_draft=${draft}" >> $GITHUB_OUTPUT + + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' + uses: actions/checkout@v4 + + - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' + uses: dorny/paths-filter@v3.0.1 + id: changes + with: + token: '' + filters: | + unit_tests: + - 'go/**' + - 'test.go' + - 'Makefile' + - 'build.env' + - 'go.sum' + - 'go.mod' + - 'proto/*.proto' + - 'tools/**' + - 'config/**' + - 'bootstrap.sh' + - '.github/workflows/unit_test_evalengine_mysql84.yml' + + - name: Set up Go + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + uses: actions/setup-go@v5 + with: + go-version: 1.22.5 + + - name: Set up python + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + uses: actions/setup-python@v5 + + - name: Tune the OS + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + run: | + sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" + # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio + echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf + sudo sysctl -p /etc/sysctl.conf + + - name: Get dependencies + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + run: | + export DEBIAN_FRONTEND="noninteractive" + sudo apt-get -qq update + + # Uninstall any previously installed MySQL first + sudo systemctl stop apparmor + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq remove -y --purge mysql-server mysql-client mysql-common + sudo apt-get -qq -y autoremove + sudo apt-get -qq -y autoclean + sudo deluser mysql + sudo rm -rf /var/lib/mysql + sudo rm -rf /etc/mysql + + # Get key to latest MySQL repo + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb + + echo mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts | sudo debconf-set-selections + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + sudo apt-get -qq update + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-server mysql-client + + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata + sudo service mysql stop + sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 + sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ + sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" + + mkdir -p dist bin + curl -s -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist + mv dist/etcd-v3.3.10-linux-amd64/{etcd,etcdctl} bin/ + + go mod download + go install golang.org/x/tools/cmd/goimports@latest + + # install JUnit report formatter + go install github.com/vitessio/go-junit-report@HEAD + + - name: Run make tools + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + run: | + make tools + + - name: Setup launchable dependencies + if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && github.base_ref == 'main' + run: | + # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up + pip3 install --user launchable~=1.0 > /dev/null + + # verify that launchable setup is all correct. + launchable verify || true + + # Tell Launchable about the build you are producing and testing + launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source . + + - name: Run test + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + timeout-minutes: 30 + run: | + set -exo pipefail + # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file + # which musn't be more than 107 characters long. + export VTDATAROOT="/tmp/" + + export NOVTADMINBUILD=1 + export VTEVALENGINETEST="1" + + eatmydata -- make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml + + - name: Print test output and Record test result in launchable if PR is not a draft + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && always() + run: | + if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then + # send recorded tests to launchable + launchable record tests --build "$GITHUB_RUN_ID" go-test . || true + fi + + # print test output + cat output.txt + + - name: Test Summary + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && always() + uses: test-summary/action@v2 + with: + paths: "report.xml" + show: "fail, skip" diff --git a/.github/workflows/unit_test_mysql57.yml b/.github/workflows/unit_test_mysql57.yml index cd28efef0d8..1ccf3e320a9 100644 --- a/.github/workflows/unit_test_mysql57.yml +++ b/.github/workflows/unit_test_mysql57.yml @@ -102,9 +102,8 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb - # mysql57 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb # Bionic packages are still compatible for Jammy since there's no MySQL 5.7 # packages for Jammy. echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections @@ -112,7 +111,7 @@ jobs: sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 - + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata sudo service mysql stop sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 diff --git a/.github/workflows/unit_test_mysql80.yml b/.github/workflows/unit_test_mysql80.yml index e66423ad1b7..1984d36a5a9 100644 --- a/.github/workflows/unit_test_mysql80.yml +++ b/.github/workflows/unit_test_mysql80.yml @@ -102,14 +102,13 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb - # mysql80 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-server mysql-client - + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata sudo service mysql stop sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 diff --git a/.github/workflows/unit_test_mysql84.yml b/.github/workflows/unit_test_mysql84.yml new file mode 100644 index 00000000000..f3fab513358 --- /dev/null +++ b/.github/workflows/unit_test_mysql84.yml @@ -0,0 +1,175 @@ +# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" + +name: Unit Test (mysql84) +on: [push, pull_request] +concurrency: + group: format('{0}-{1}', ${{ github.ref }}, 'Unit Test (mysql84)') + cancel-in-progress: true + +permissions: read-all + +env: + LAUNCHABLE_ORGANIZATION: "vitess" + LAUNCHABLE_WORKSPACE: "vitess-app" + GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}" + +jobs: + test: + name: Unit Test (mysql84) + runs-on: gh-hosted-runners-4cores-1 + + steps: + - name: Skip CI + run: | + if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then + echo "skipping CI due to the 'Skip CI' label" + exit 1 + fi + + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT + + PR_DATA=$(curl \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") + draft=$(echo "$PR_DATA" | jq .draft -r) + echo "is_draft=${draft}" >> $GITHUB_OUTPUT + + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' + uses: actions/checkout@v4 + + - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' + uses: dorny/paths-filter@v3.0.1 + id: changes + with: + token: '' + filters: | + unit_tests: + - 'go/**' + - 'test.go' + - 'Makefile' + - 'build.env' + - 'go.sum' + - 'go.mod' + - 'proto/*.proto' + - 'tools/**' + - 'config/**' + - 'bootstrap.sh' + - '.github/workflows/unit_test_mysql84.yml' + + - name: Set up Go + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + uses: actions/setup-go@v5 + with: + go-version: 1.22.5 + + - name: Set up python + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + uses: actions/setup-python@v5 + + - name: Tune the OS + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + run: | + sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" + # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio + echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf + sudo sysctl -p /etc/sysctl.conf + + - name: Get dependencies + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + run: | + export DEBIAN_FRONTEND="noninteractive" + sudo apt-get -qq update + + # Uninstall any previously installed MySQL first + sudo systemctl stop apparmor + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq remove -y --purge mysql-server mysql-client mysql-common + sudo apt-get -qq -y autoremove + sudo apt-get -qq -y autoclean + sudo deluser mysql + sudo rm -rf /var/lib/mysql + sudo rm -rf /etc/mysql + + # Get key to latest MySQL repo + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb + + echo mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts | sudo debconf-set-selections + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + sudo apt-get -qq update + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-server mysql-client + + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata + sudo service mysql stop + sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 + sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ + sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" + + mkdir -p dist bin + curl -s -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist + mv dist/etcd-v3.3.10-linux-amd64/{etcd,etcdctl} bin/ + + go mod download + go install golang.org/x/tools/cmd/goimports@latest + + # install JUnit report formatter + go install github.com/vitessio/go-junit-report@HEAD + + - name: Run make tools + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + run: | + make tools + + - name: Setup launchable dependencies + if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && github.base_ref == 'main' + run: | + # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up + pip3 install --user launchable~=1.0 > /dev/null + + # verify that launchable setup is all correct. + launchable verify || true + + # Tell Launchable about the build you are producing and testing + launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source . + + - name: Run test + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' + timeout-minutes: 30 + run: | + set -exo pipefail + # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file + # which musn't be more than 107 characters long. + export VTDATAROOT="/tmp/" + + export NOVTADMINBUILD=1 + export VTEVALENGINETEST="0" + + eatmydata -- make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml + + - name: Print test output and Record test result in launchable if PR is not a draft + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && always() + run: | + if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then + # send recorded tests to launchable + launchable record tests --build "$GITHUB_RUN_ID" go-test . || true + fi + + # print test output + cat output.txt + + - name: Test Summary + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && always() + uses: test-summary/action@v2 + with: + paths: "report.xml" + show: "fail, skip" diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual.yml b/.github/workflows/upgrade_downgrade_test_backups_manual.yml index 3f25e2c8663..9c98b643c3e 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual.yml @@ -102,7 +102,7 @@ jobs: # Install MySQL 8.0 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml index 83a678fc065..1cdfcee1fec 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml @@ -103,7 +103,7 @@ jobs: # Install MySQL 8.0 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml b/.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml index c280365b6d3..c32a24ab083 100644 --- a/.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml +++ b/.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml @@ -108,7 +108,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml index 93360699f93..ded814c6ac9 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml @@ -100,7 +100,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml index 6c3674a1d75..845ab33c6bb 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml @@ -101,7 +101,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml index cc519f335cf..1006179a97a 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml @@ -100,7 +100,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml index c1864a9a3e7..1c30fe53c2f 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml @@ -101,7 +101,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml index 66033484ce3..853dd172ff6 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml @@ -101,7 +101,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml index d937bc7bc11..90c41d4ee09 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml @@ -101,7 +101,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml index ac6ef068654..7008f07ce44 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml @@ -100,7 +100,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml index df0cdb9c7c9..e1240dd9a13 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml @@ -100,7 +100,7 @@ jobs: sudo rm -rf /etc/mysql # Install mysql80 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/vitess_tester_vtgate.yml b/.github/workflows/vitess_tester_vtgate.yml index 0c2965fee9c..92da495ebe8 100644 --- a/.github/workflows/vitess_tester_vtgate.yml +++ b/.github/workflows/vitess_tester_vtgate.yml @@ -95,7 +95,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/test/ci_workflow_gen.go b/test/ci_workflow_gen.go index 9ead7f07963..f23b9142397 100644 --- a/test/ci_workflow_gen.go +++ b/test/ci_workflow_gen.go @@ -31,6 +31,7 @@ type mysqlVersion string const ( mysql57 mysqlVersion = "mysql57" mysql80 mysqlVersion = "mysql80" + mysql84 mysqlVersion = "mysql84" defaultMySQLVersion = mysql80 ) @@ -42,7 +43,7 @@ var ( ) var ( - unitTestDatabases = []mysqlVersion{mysql57, mysql80} + unitTestDatabases = []mysqlVersion{mysql57, mysql80, mysql84} ) const ( diff --git a/test/templates/cluster_endtoend_test.tpl b/test/templates/cluster_endtoend_test.tpl index 46078cfcc0c..60205342df4 100644 --- a/test/templates/cluster_endtoend_test.tpl +++ b/test/templates/cluster_endtoend_test.tpl @@ -124,7 +124,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/test/templates/cluster_endtoend_test_mysql57.tpl b/test/templates/cluster_endtoend_test_mysql57.tpl index 17d49c382e2..a29698da472 100644 --- a/test/templates/cluster_endtoend_test_mysql57.tpl +++ b/test/templates/cluster_endtoend_test_mysql57.tpl @@ -126,7 +126,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb # Bionic packages are still compatible for Jammy since there's no MySQL 5.7 # packages for Jammy. echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections diff --git a/test/templates/cluster_vitess_tester.tpl b/test/templates/cluster_vitess_tester.tpl index bd34c2de088..1ca588d7c87 100644 --- a/test/templates/cluster_vitess_tester.tpl +++ b/test/templates/cluster_vitess_tester.tpl @@ -93,7 +93,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update diff --git a/test/templates/unit_test.tpl b/test/templates/unit_test.tpl index 7fd872bde1d..21707a89e48 100644 --- a/test/templates/unit_test.tpl +++ b/test/templates/unit_test.tpl @@ -98,12 +98,11 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql - {{if (eq .Platform "mysql57")}} # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb - # mysql57 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb + {{if (eq .Platform "mysql57")}} # Bionic packages are still compatible for Jammy since there's no MySQL 5.7 # packages for Jammy. echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections @@ -111,20 +110,20 @@ jobs: sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 - {{end}} {{if (eq .Platform "mysql80")}} - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C - - # mysql80 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get -qq update sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-server mysql-client + {{end}} + {{if (eq .Platform "mysql84")}} + echo mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts | sudo debconf-set-selections + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + sudo apt-get -qq update + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-server mysql-client {{end}} sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata From 011046866cbec5429cd2ec5dc1e42d1d76774c6e Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Mon, 22 Jul 2024 23:07:01 +0200 Subject: [PATCH 2/8] Handle new restrict_fk_on_non_standard_key option in MySQL 8.4 MySQL 8.4 adds restrict_fk_on_non_standard_key for which the details can be found here: https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_restrict_fk_on_non_standard_key It prevents the use of non-unique keys or partial keys as foreign keys. For regular MySQL replication though, it does the following: Implication for MySQL Replication. When a foreign key is created on a nonstandard key on the primary because restrict_fk_on_non_standard_key is OFF, the statement succeeds on the replica regardless of any setting on the replica for this variable. Given how this works fir regular replication, we should mirror this behavior for vreplication and always allow this. So we set it up so we can do this with similar logic as to how we disable foreign key checks and we reset it back afterwards. Signed-off-by: Dirkjan Bussink --- go/vt/binlog/binlogplayer/dbclient.go | 5 ++ go/vt/binlog/binlogplayer/fake_dbclient.go | 5 ++ go/vt/binlog/binlogplayer/mock_dbclient.go | 5 ++ .../tabletmanager/vdiff/framework_test.go | 4 ++ .../vreplication/framework_test.go | 4 ++ .../tabletmanager/vreplication/vreplicator.go | 56 +++++++++++++++++++ .../vreplication/vreplicator_test.go | 13 ++++- go/vt/wrangler/fake_dbclient_test.go | 5 ++ 8 files changed, 96 insertions(+), 1 deletion(-) diff --git a/go/vt/binlog/binlogplayer/dbclient.go b/go/vt/binlog/binlogplayer/dbclient.go index 61789f345c7..89de8bdc6b0 100644 --- a/go/vt/binlog/binlogplayer/dbclient.go +++ b/go/vt/binlog/binlogplayer/dbclient.go @@ -41,6 +41,7 @@ type DBClient interface { Close() ExecuteFetch(query string, maxrows int) (qr *sqltypes.Result, err error) ExecuteFetchMulti(query string, maxrows int) (qrs []*sqltypes.Result, err error) + ServerVersion() string } // dbClientImpl is a real DBClient backed by a mysql connection. @@ -123,6 +124,10 @@ func (dc *dbClientImpl) Close() { dc.dbConn.Close() } +func (dc *dbClientImpl) ServerVersion() string { + return dc.dbConn.ServerVersion +} + // LogError logs a message after truncating it to avoid spamming logs func LogError(msg string, err error) { log.Errorf("%s: %s", msg, MessageTruncate(err.Error())) diff --git a/go/vt/binlog/binlogplayer/fake_dbclient.go b/go/vt/binlog/binlogplayer/fake_dbclient.go index 750f35b3fe3..2885479cdbc 100644 --- a/go/vt/binlog/binlogplayer/fake_dbclient.go +++ b/go/vt/binlog/binlogplayer/fake_dbclient.go @@ -20,6 +20,7 @@ import ( "fmt" "strings" + "vitess.io/vitess/go/mysql/config" "vitess.io/vitess/go/sqltypes" ) @@ -84,3 +85,7 @@ func (dc *fakeDBClient) ExecuteFetch(query string, maxrows int) (qr *sqltypes.Re func (dc *fakeDBClient) ExecuteFetchMulti(query string, maxrows int) ([]*sqltypes.Result, error) { return make([]*sqltypes.Result, 0), nil } + +func (dc *fakeDBClient) ServerVersion() string { + return config.DefaultMySQLVersion +} diff --git a/go/vt/binlog/binlogplayer/mock_dbclient.go b/go/vt/binlog/binlogplayer/mock_dbclient.go index 02e7ea28d7b..09fa19ac559 100644 --- a/go/vt/binlog/binlogplayer/mock_dbclient.go +++ b/go/vt/binlog/binlogplayer/mock_dbclient.go @@ -24,6 +24,7 @@ import ( "testing" "time" + "vitess.io/vitess/go/mysql/config" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/sqlparser" ) @@ -260,3 +261,7 @@ func (dc *MockDBClient) RemoveInvariant(query string) { defer dc.expectMu.Unlock() delete(dc.invariants, query) } + +func (dc *MockDBClient) ServerVersion() string { + return config.DefaultMySQLVersion +} diff --git a/go/vt/vttablet/tabletmanager/vdiff/framework_test.go b/go/vt/vttablet/tabletmanager/vdiff/framework_test.go index cf24950bda3..4b658fb3afd 100644 --- a/go/vt/vttablet/tabletmanager/vdiff/framework_test.go +++ b/go/vt/vttablet/tabletmanager/vdiff/framework_test.go @@ -422,6 +422,10 @@ func (dbc *realDBClient) ExecuteFetchMulti(query string, maxrows int) ([]*sqltyp return results, nil } +func (dbc *realDBClient) ServerVersion() string { + return dbc.conn.ServerVersion +} + //---------------------------------------------- // fakeTMClient diff --git a/go/vt/vttablet/tabletmanager/vreplication/framework_test.go b/go/vt/vttablet/tabletmanager/vreplication/framework_test.go index d4253de27e7..978322fd7e5 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/framework_test.go +++ b/go/vt/vttablet/tabletmanager/vreplication/framework_test.go @@ -509,6 +509,10 @@ func (dbc *realDBClient) ExecuteFetchMulti(query string, maxrows int) ([]*sqltyp return results, nil } +func (dbc *realDBClient) ServerVersion() string { + return dbc.conn.ServerVersion +} + func expectDeleteQueries(t *testing.T) { t.Helper() if doNotLogDBQueries { diff --git a/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go b/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go index 8a01cf7c8ed..4e9e31c3ca7 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go @@ -26,6 +26,7 @@ import ( "strings" "time" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/mysql/replication" "vitess.io/vitess/go/mysql/sqlerror" "vitess.io/vitess/go/sqltypes" @@ -105,6 +106,7 @@ type vreplicator struct { originalFKCheckSetting int64 originalSQLMode string + originalFKRestrict int64 WorkflowType int32 WorkflowSubType int32 @@ -239,6 +241,10 @@ func (vr *vreplicator) replicate(ctx context.Context) error { } //defensive guard, should be a no-op since it should happen after copy is done defer vr.resetFKCheckAfterCopy(vr.dbClient) + if err := vr.getSettingFKRestrict(); err != nil { + return err + } + defer vr.resetFKRestrictAfterCopy(vr.dbClient) vr.throttleUpdatesRateLimiter = timer.NewRateLimiter(time.Second) defer vr.throttleUpdatesRateLimiter.Stop() @@ -272,6 +278,10 @@ func (vr *vreplicator) replicate(ctx context.Context) error { log.Warningf("Unable to clear FK check %v", err) return err } + if err := vr.clearFKRestrict(vr.dbClient); err != nil { + log.Warningf("Unable to clear FK restrict %v", err) + return err + } if vr.WorkflowSubType == int32(binlogdatapb.VReplicationWorkflowSubType_AtomicCopy) { if err := newVCopier(vr).copyAll(ctx, settings); err != nil { log.Infof("Error atomically copying all tables: %v", err) @@ -301,6 +311,10 @@ func (vr *vreplicator) replicate(ctx context.Context) error { log.Warningf("Unable to reset FK check %v", err) return err } + if err := vr.resetFKRestrictAfterCopy(vr.dbClient); err != nil { + log.Warningf("Unable to reset FK restrict %v", err) + return err + } if vr.source.StopAfterCopy { return vr.setState(binlogdatapb.VReplicationWorkflowState_Stopped, "Stopped after copy.") } @@ -512,11 +526,42 @@ func (vr *vreplicator) getSettingFKCheck() error { return nil } +func (vr *vreplicator) needFKRestrict() bool { + ok, _ := capabilities.ServerVersionAtLeast(vr.dbClient.ServerVersion(), 8, 4, 0) + return ok +} + +func (vr *vreplicator) getSettingFKRestrict() error { + if !vr.needFKRestrict() { + return nil + } + qr, err := vr.dbClient.Execute("select @@session.restrict_fk_on_non_standard_key") + if err != nil { + return err + } + if len(qr.Rows) != 1 || len(qr.Fields) != 1 { + return fmt.Errorf("unable to select @@session.restrict_fk_on_non_standard_key") + } + vr.originalFKRestrict, err = qr.Rows[0][0].ToCastInt64() + if err != nil { + return err + } + return nil +} + func (vr *vreplicator) resetFKCheckAfterCopy(dbClient *vdbClient) error { _, err := dbClient.Execute(fmt.Sprintf("set @@session.foreign_key_checks=%d", vr.originalFKCheckSetting)) return err } +func (vr *vreplicator) resetFKRestrictAfterCopy(dbClient *vdbClient) error { + if !vr.needFKRestrict() { + return nil + } + _, err := dbClient.Execute(fmt.Sprintf("set @@session.restrict_fk_on_non_standard_key=%d", vr.originalFKRestrict)) + return err +} + func (vr *vreplicator) setSQLMode(ctx context.Context, dbClient *vdbClient) (func(), error) { resetFunc := func() {} // First save the original SQL mode if we have not already done so @@ -616,6 +661,14 @@ func (vr *vreplicator) clearFKCheck(dbClient *vdbClient) error { return err } +func (vr *vreplicator) clearFKRestrict(dbClient *vdbClient) error { + if !vr.needFKRestrict() { + return nil + } + _, err := dbClient.Execute("set @@session.restrict_fk_on_non_standard_key=0") + return err +} + func recalculatePKColsInfoByColumnNames(uniqueKeyColumnNames []string, colInfos []*ColumnInfo) (pkColInfos []*ColumnInfo) { pkColInfos = colInfos[:] columnOrderMap := map[string]int64{} @@ -1056,6 +1109,9 @@ func (vr *vreplicator) newClientConnection(ctx context.Context) (*vdbClient, err if err := vr.clearFKCheck(dbClient); err != nil { return nil, vterrors.Wrap(err, "failed to clear foreign key check") } + if err := vr.clearFKRestrict(dbClient); err != nil { + return nil, vterrors.Wrap(err, "failed to clear foreign key restriction") + } return dbClient, nil } diff --git a/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go b/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go index e4f55cc2384..e559939c9d3 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go @@ -31,6 +31,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/vt/binlog/binlogplayer" "vitess.io/vitess/go/vt/dbconfigs" "vitess.io/vitess/go/vt/mysqlctl" @@ -481,7 +482,17 @@ func TestDeferSecondaryKeys(t *testing.T) { } // Create the table. - _, err := dbClient.ExecuteFetch(tcase.initialDDL, 1) + capability, err := capabilities.ServerVersionAtLeast(dbClient.ServerVersion(), 8, 4, 0) + require.NoError(t, err) + if capability { + _, err := dbClient.ExecuteFetch("set @@session.restrict_fk_on_non_standard_key=0", 1) + require.NoError(t, err) + defer func() { + _, err = dbClient.ExecuteFetch("set @@session.restrict_fk_on_non_standard_key=1", 1) + require.NoError(t, err) + }() + } + _, err = dbClient.ExecuteFetch(tcase.initialDDL, 1) require.NoError(t, err) defer func() { _, err = dbClient.ExecuteFetch(fmt.Sprintf("drop table %s.%s", dbName, tcase.tableName), 1) diff --git a/go/vt/wrangler/fake_dbclient_test.go b/go/vt/wrangler/fake_dbclient_test.go index 7fce5ce9afc..80d0b25da73 100644 --- a/go/vt/wrangler/fake_dbclient_test.go +++ b/go/vt/wrangler/fake_dbclient_test.go @@ -25,6 +25,7 @@ import ( "github.com/stretchr/testify/assert" + "vitess.io/vitess/go/mysql/config" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/sqlparser" @@ -177,6 +178,10 @@ func (dc *fakeDBClient) ExecuteFetchMulti(query string, maxrows int) ([]*sqltype return results, nil } +func (dc *fakeDBClient) ServerVersion() string { + return config.DefaultMySQLVersion +} + // ExecuteFetch is part of the DBClient interface func (dc *fakeDBClient) executeFetch(query string, maxrows int) (*sqltypes.Result, error) { if dbrs := dc.queries[query]; dbrs != nil { From 4033556d2706f03487eab87d21b5d2e520e260c6 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Tue, 23 Jul 2024 12:02:49 +0200 Subject: [PATCH 3/8] Fix YEAR workaround for prepared statements In https://github.com/vitessio/vitess/pull/7020 the logic was changed to always map YEAR to binary. But that is wrong, since this breaks the text protocol. Instead, we need to make sure that when we parse the binary data for prepared statements, we treat YEAR there as binary. That ensures we can parse it the way it's encoded in practice in the protocol (and not how it is documented). Signed-off-by: Dirkjan Bussink --- go/mysql/query.go | 4 ++-- go/mysql/query_test.go | 5 +---- go/sqltypes/type.go | 4 ---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/go/mysql/query.go b/go/mysql/query.go index 22299e5cc80..8f196aa53b3 100644 --- a/go/mysql/query.go +++ b/go/mysql/query.go @@ -685,7 +685,7 @@ func (c *Conn) parseStmtArgs(data []byte, typ querypb.Type, pos int) (sqltypes.V case sqltypes.Uint16: val, pos, ok := readUint16(data, pos) return sqltypes.NewUint64(uint64(val)), pos, ok - case sqltypes.Int16, sqltypes.Year: + case sqltypes.Int16: val, pos, ok := readUint16(data, pos) return sqltypes.NewInt64(int64(int16(val))), pos, ok case sqltypes.Uint24, sqltypes.Uint32: @@ -890,7 +890,7 @@ func (c *Conn) parseStmtArgs(data []byte, typ querypb.Type, pos int) (sqltypes.V default: return sqltypes.NULL, 0, false } - case sqltypes.Decimal, sqltypes.Text, sqltypes.Blob, sqltypes.VarChar, sqltypes.VarBinary, sqltypes.Char, + case sqltypes.Decimal, sqltypes.Text, sqltypes.Blob, sqltypes.VarChar, sqltypes.VarBinary, sqltypes.Year, sqltypes.Char, sqltypes.Bit, sqltypes.Enum, sqltypes.Set, sqltypes.Geometry, sqltypes.Binary, sqltypes.TypeJSON: val, pos, ok := readLenEncStringAsBytesCopy(data, pos) return sqltypes.MakeTrusted(sqltypes.VarBinary, val), pos, ok diff --git a/go/mysql/query_test.go b/go/mysql/query_test.go index 0e1f48c1804..2915b754582 100644 --- a/go/mysql/query_test.go +++ b/go/mysql/query_test.go @@ -315,10 +315,7 @@ func TestComStmtExecuteUpdStmt(t *testing.T) { assert.EqualValues(t, querypb.Type_DATETIME, prepData.ParamsType[15], "got: %s", querypb.Type(prepData.ParamsType[15])) assert.EqualValues(t, querypb.Type_TIMESTAMP, prepData.ParamsType[16], "got: %s", querypb.Type(prepData.ParamsType[16])) assert.EqualValues(t, querypb.Type_TIME, prepData.ParamsType[17], "got: %s", querypb.Type(prepData.ParamsType[17])) - - // this is year but in binary it is changed to varbinary - assert.EqualValues(t, querypb.Type_VARBINARY, prepData.ParamsType[18], "got: %s", querypb.Type(prepData.ParamsType[18])) - + assert.EqualValues(t, querypb.Type_YEAR, prepData.ParamsType[18], "got: %s", querypb.Type(prepData.ParamsType[18])) assert.EqualValues(t, querypb.Type_CHAR, prepData.ParamsType[19], "got: %s", querypb.Type(prepData.ParamsType[19])) assert.EqualValues(t, querypb.Type_CHAR, prepData.ParamsType[20], "got: %s", querypb.Type(prepData.ParamsType[20])) assert.EqualValues(t, querypb.Type_TEXT, prepData.ParamsType[21], "got: %s", querypb.Type(prepData.ParamsType[21])) diff --git a/go/sqltypes/type.go b/go/sqltypes/type.go index 4090dd0107a..437d285777b 100644 --- a/go/sqltypes/type.go +++ b/go/sqltypes/type.go @@ -276,10 +276,6 @@ func modifyType(typ querypb.Type, flags int64) querypb.Type { if flags&mysqlSet != 0 { return Set } - case Year: - if flags&mysqlBinary != 0 { - return VarBinary - } } return typ } From 842405e616d4135d1bf6f93b2096458f0ce68b94 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Tue, 23 Jul 2024 12:08:32 +0200 Subject: [PATCH 4/8] Fix evalengine behavior for newer MySQL versions There's some small changes for newer MySQL versions around typing information for certain functions etc. This adopts those changes for newer versions. Signed-off-by: Dirkjan Bussink --- go/vt/vtgate/evalengine/compiler_asm.go | 42 +++++++++++++++----- go/vt/vtgate/evalengine/compiler_test.go | 4 ++ go/vt/vtgate/evalengine/eval_numeric.go | 12 ++++++ go/vt/vtgate/evalengine/fn_string.go | 40 +++++++++++++++++-- go/vt/vtgate/evalengine/fn_time.go | 11 ++++- go/vt/vtgate/evalengine/testcases/cases.go | 3 ++ go/vt/vtgate/evalengine/testcases/helpers.go | 13 ++++++ 7 files changed, 111 insertions(+), 14 deletions(-) diff --git a/go/vt/vtgate/evalengine/compiler_asm.go b/go/vt/vtgate/evalengine/compiler_asm.go index 6c8896bb1f4..0cac66d9e5e 100644 --- a/go/vt/vtgate/evalengine/compiler_asm.go +++ b/go/vt/vtgate/evalengine/compiler_asm.go @@ -2670,15 +2670,22 @@ func (asm *assembler) Fn_MULTICMP_u(args int, lessThan bool) { }, "FN MULTICMP UINT64(SP-%d)...UINT64(SP-1)", args) } -func (asm *assembler) Fn_REPEAT() { +func (asm *assembler) Fn_REPEAT(base sqltypes.Type, fallback sqltypes.Type) { asm.adjustStack(-1) asm.emit(func(env *ExpressionEnv) int { str := env.vm.stack[env.vm.sp-2].(*evalBytes) repeat := env.vm.stack[env.vm.sp-1].(*evalInt64) + if len(str.bytes) == 0 { + str.bytes = nil + env.vm.sp-- + return 1 + } + negative := false if repeat.i < 0 { repeat.i = 0 + negative = true } if !validMaxLength(int64(len(str.bytes)), repeat.i) { @@ -2687,8 +2694,12 @@ func (asm *assembler) Fn_REPEAT() { return 1 } - str.tt = int16(sqltypes.VarChar) str.bytes = bytes.Repeat(str.bytes, int(repeat.i)) + if len(str.bytes) >= repeatTypeChangeLength || negative { + str.tt = int16(fallback) + } else { + str.tt = int16(base) + } env.vm.sp-- return 1 }, "FN REPEAT VARCHAR(SP-2) INT64(SP-1)") @@ -4238,15 +4249,26 @@ func (asm *assembler) Fn_WEEKOFYEAR() { }, "FN WEEKOFYEAR DATE(SP-1)") } -func (asm *assembler) Fn_YEAR() { - asm.emit(func(env *ExpressionEnv) int { - if env.vm.stack[env.vm.sp-1] == nil { +func (asm *assembler) Fn_YEAR(yearType bool) { + if yearType { + asm.emit(func(env *ExpressionEnv) int { + if env.vm.stack[env.vm.sp-1] == nil { + return 1 + } + arg := env.vm.stack[env.vm.sp-1].(*evalTemporal) + env.vm.stack[env.vm.sp-1] = newEvalYear(int64(arg.dt.Date.Year())) return 1 - } - arg := env.vm.stack[env.vm.sp-1].(*evalTemporal) - env.vm.stack[env.vm.sp-1] = env.vm.arena.newEvalInt64(int64(arg.dt.Date.Year())) - return 1 - }, "FN YEAR DATE(SP-1)") + }, "FN YEAR DATE(SP-1)") + } else { + asm.emit(func(env *ExpressionEnv) int { + if env.vm.stack[env.vm.sp-1] == nil { + return 1 + } + arg := env.vm.stack[env.vm.sp-1].(*evalTemporal) + env.vm.stack[env.vm.sp-1] = env.vm.arena.newEvalInt64(int64(arg.dt.Date.Year())) + return 1 + }, "FN YEAR DATE(SP-1)") + } } func (asm *assembler) Fn_YEARWEEK0() { diff --git a/go/vt/vtgate/evalengine/compiler_test.go b/go/vt/vtgate/evalengine/compiler_test.go index 04eb72ad4f2..73646f45a6c 100644 --- a/go/vt/vtgate/evalengine/compiler_test.go +++ b/go/vt/vtgate/evalengine/compiler_test.go @@ -723,6 +723,10 @@ func TestCompilerSingle(t *testing.T) { expression: `cast(_utf32 0x0000FF as binary)`, result: `VARBINARY("\x00\x00\x00\xff")`, }, + { + expression: `MAKETIME(-9223372036854775808, '3', 1.5)`, + result: `TIME("-00:03:01.5")`, + }, } tz, _ := time.LoadLocation("Europe/Madrid") diff --git a/go/vt/vtgate/evalengine/eval_numeric.go b/go/vt/vtgate/evalengine/eval_numeric.go index 04f844566b1..3ccdfde68fa 100644 --- a/go/vt/vtgate/evalengine/eval_numeric.go +++ b/go/vt/vtgate/evalengine/eval_numeric.go @@ -58,6 +58,10 @@ type ( dec decimal.Decimal length int32 } + + evalYear struct { + evalInt64 + } ) var _ evalNumeric = (*evalInt64)(nil) @@ -102,6 +106,10 @@ func newEvalBool(b bool) *evalInt64 { return evalBoolFalse } +func newEvalYear(i int64) *evalYear { + return &evalYear{evalInt64{i: i}} +} + func evalToNumeric(e eval, preciseDatetime bool) evalNumeric { switch e := e.(type) { case evalNumeric: @@ -616,3 +624,7 @@ func (e *evalDecimal) toUint64() *evalUint64 { } return newEvalUint64(u) } + +func (e *evalYear) SQLType() sqltypes.Type { + return sqltypes.Year +} diff --git a/go/vt/vtgate/evalengine/fn_string.go b/go/vt/vtgate/evalengine/fn_string.go index 663475327e5..6d83d36412d 100644 --- a/go/vt/vtgate/evalengine/fn_string.go +++ b/go/vt/vtgate/evalengine/fn_string.go @@ -20,6 +20,7 @@ import ( "bytes" "math" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/mysql/collations" "vitess.io/vitess/go/mysql/collations/charset" "vitess.io/vitess/go/mysql/collations/colldata" @@ -889,6 +890,23 @@ func (call *builtinOrd) compile(c *compiler) (ctype, error) { // error: `ERROR 2020 (HY000): Got packet bigger than 'max_allowed_packet' bytes` and the client gets disconnected. // - `> max_allowed_packet`, no error and returns `NULL`. const maxRepeatLength = 1073741824 +const repeatTypeChangeLength = 16384 + +// repeatType returns the type for the REPEAT result. +// MySQL 8.1.x and later has changed this to return TEXT instead of VARCHAR. +func repeatType(version string, base sqltypes.Type) sqltypes.Type { + capability, _ := capabilities.ServerVersionAtLeast(version, 8, 1, 0) + if capability { + if sqltypes.IsBinary(base) { + return sqltypes.Blob + } + return sqltypes.Text + } + if sqltypes.IsBinary(base) { + return sqltypes.VarBinary + } + return sqltypes.VarChar +} func (call *builtinRepeat) eval(env *ExpressionEnv) (eval, error) { arg1, arg2, err := call.arg2(env) @@ -900,22 +918,36 @@ func (call *builtinRepeat) eval(env *ExpressionEnv) (eval, error) { } text, ok := arg1.(*evalBytes) - if !ok { + tt := sqltypes.VarChar + if ok { + tt = text.SQLType() + } else { text, err = evalToVarchar(arg1, call.collate, true) if err != nil { return nil, err } } + if len(text.bytes) == 0 { + return newEvalText(nil, text.col), nil + } + repeat := evalToInt64(arg2).i + negative := false if repeat < 0 { repeat = 0 + negative = true } if !validMaxLength(int64(len(text.bytes)), repeat) { return nil, nil } - return newEvalText(bytes.Repeat(text.bytes, int(repeat)), text.col), nil + b := bytes.Repeat(text.bytes, int(repeat)) + if len(b) >= repeatTypeChangeLength || negative { + tt = repeatType(env.currentVersion(), tt) + } + + return newEvalRaw(tt, b, text.col), nil } func validMaxLength(len, repeat int64) bool { @@ -942,14 +974,16 @@ func (expr *builtinRepeat) compile(c *compiler) (ctype, error) { skip := c.compileNullCheck2(str, repeat) + tt := sqltypes.VarChar switch { case str.isTextual(): + tt = str.Type default: c.asm.Convert_xc(2, sqltypes.VarChar, c.collation, nil) } _ = c.compileToInt64(repeat, 1) - c.asm.Fn_REPEAT() + c.asm.Fn_REPEAT(tt, repeatType(c.env.MySQLVersion(), tt)) c.asm.jumpDestination(skip) return ctype{Type: sqltypes.VarChar, Col: str.Col, Flag: flagNullable}, nil } diff --git a/go/vt/vtgate/evalengine/fn_time.go b/go/vt/vtgate/evalengine/fn_time.go index 5a253799b7f..8d920e9e135 100644 --- a/go/vt/vtgate/evalengine/fn_time.go +++ b/go/vt/vtgate/evalengine/fn_time.go @@ -21,6 +21,7 @@ import ( "time" "vitess.io/vitess/go/hack" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/mysql/collations" "vitess.io/vitess/go/mysql/datetime" "vitess.io/vitess/go/mysql/decimal" @@ -1859,6 +1860,11 @@ func (call *builtinWeekOfYear) compile(c *compiler) (ctype, error) { return ctype{Type: sqltypes.Int64, Col: collationNumeric, Flag: arg.Flag | flagNullable}, nil } +func yearType(version string) bool { + capability, _ := capabilities.ServerVersionAtLeast(version, 8, 1, 0) + return capability +} + func (b *builtinYear) eval(env *ExpressionEnv) (eval, error) { date, err := b.arg1(env) if err != nil { @@ -1872,6 +1878,9 @@ func (b *builtinYear) eval(env *ExpressionEnv) (eval, error) { return nil, nil } + if yearType(env.currentVersion()) { + return newEvalYear(int64(d.dt.Date.Year())), nil + } return newEvalInt64(int64(d.dt.Date.Year())), nil } @@ -1889,7 +1898,7 @@ func (call *builtinYear) compile(c *compiler) (ctype, error) { c.asm.Convert_xD(1, true) } - c.asm.Fn_YEAR() + c.asm.Fn_YEAR(yearType(c.env.MySQLVersion())) c.asm.jumpDestination(skip) return ctype{Type: sqltypes.Int64, Col: collationNumeric, Flag: arg.Flag | flagNullable}, nil } diff --git a/go/vt/vtgate/evalengine/testcases/cases.go b/go/vt/vtgate/evalengine/testcases/cases.go index c937e7dbbc0..003eb45c0a3 100644 --- a/go/vt/vtgate/evalengine/testcases/cases.go +++ b/go/vt/vtgate/evalengine/testcases/cases.go @@ -1960,6 +1960,9 @@ func FnMaketime(yield Query) { "''", "0", "'3'", "59", "60", "0xFF666F6F626172FF", "18446744073709551615", } for _, h := range inputConversions { + if !(bugs{}).MakeTimeValidHours(h) { + continue + } for _, m := range minutes { for _, s := range inputConversions { yield(fmt.Sprintf("MAKETIME(%s, %s, %s)", h, m, s), nil) diff --git a/go/vt/vtgate/evalengine/testcases/helpers.go b/go/vt/vtgate/evalengine/testcases/helpers.go index a908b8196c8..71602e12c1c 100644 --- a/go/vt/vtgate/evalengine/testcases/helpers.go +++ b/go/vt/vtgate/evalengine/testcases/helpers.go @@ -21,6 +21,7 @@ import ( "math" "reflect" "runtime" + "strconv" "strings" "time" @@ -134,6 +135,18 @@ func (bugs) CanCompare(elems ...string) bool { return true } +// MakeTimeValidHours returns true if the hour input for MAKETIME +// is not an invalid edge case. Starting with MySQL 8.4.0, it somehow +// truncates this value to a negative zero. This seems pretty much +// broken as other large negative values are not truncated. +func (bugs) MakeTimeValidHours(input string) bool { + i, err := strconv.ParseInt(input, 10, 64) + if err != nil { + return true + } + return i != math.MinInt64 +} + type Comparison struct { Decimals uint32 LooseTime bool From 9f6d788b268755ca0c61e564cc411baef1def94b Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Tue, 23 Jul 2024 13:29:26 +0200 Subject: [PATCH 5/8] Fix FilePos replication for 8.4 Signed-off-by: Dirkjan Bussink --- go/mysql/flavor_filepos.go | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/go/mysql/flavor_filepos.go b/go/mysql/flavor_filepos.go index 5e766e81912..4ee13eb6c01 100644 --- a/go/mysql/flavor_filepos.go +++ b/go/mysql/flavor_filepos.go @@ -44,7 +44,13 @@ func newFilePosFlavor() flavor { // primaryGTIDSet is part of the Flavor interface. func (flv *filePosFlavor) primaryGTIDSet(c *Conn) (replication.GTIDSet, error) { - qr, err := c.ExecuteFetch("SHOW MASTER STATUS", 100, true /* wantfields */) + query := "SHOW MASTER STATUS" + capability, _ := capabilities.ServerVersionAtLeast(c.ServerVersion, 8, 4, 0) + if capability { + query = "SHOW BINARY LOG STATUS" + } + + qr, err := c.ExecuteFetch(query, 100, true /* wantfields */) if err != nil { return nil, err } @@ -291,14 +297,23 @@ func (flv *filePosFlavor) waitUntilPosition(ctx context.Context, c *Conn, pos re if !ok { return vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "position is not filePos compatible: %#v", pos.GTIDSet) } + queryPos := "SELECT MASTER_POS_WAIT('%s', %d)" + queryPosSub := "SELECT MASTER_POS_WAIT('%s', %d, %.6f)" + + if capableOf := capabilities.MySQLVersionCapableOf(c.ServerVersion); capableOf != nil { + if ok, _ := capableOf(capabilities.ReplicaTerminologyCapability); ok { + queryPos = "SELECT SOURCE_POS_WAIT('%s', %d)" + queryPosSub = "SELECT SOURCE_POS_WAIT('%s', %d, %.6f)" + } + } - query := fmt.Sprintf("SELECT MASTER_POS_WAIT('%s', %d)", filePosPos.File, filePosPos.Pos) + query := fmt.Sprintf(queryPos, filePosPos.File, filePosPos.Pos) if deadline, ok := ctx.Deadline(); ok { timeout := time.Until(deadline) if timeout <= 0 { return vterrors.Errorf(vtrpcpb.Code_DEADLINE_EXCEEDED, "timed out waiting for position %v", pos) } - query = fmt.Sprintf("SELECT MASTER_POS_WAIT('%s', %d, %.6f)", filePosPos.File, filePosPos.Pos, timeout.Seconds()) + query = fmt.Sprintf(queryPosSub, filePosPos.File, filePosPos.Pos, timeout.Seconds()) } result, err := c.ExecuteFetch(query, 1, false) From 00e4c3a83cfc27b4f1ad9cdc82642baa36e9375f Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Tue, 23 Jul 2024 13:37:33 +0200 Subject: [PATCH 6/8] Rerun codegen Signed-off-by: Dirkjan Bussink --- go/vt/vtgate/evalengine/cached_size.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/go/vt/vtgate/evalengine/cached_size.go b/go/vt/vtgate/evalengine/cached_size.go index 65f0bd37d12..6f447f0d1c1 100644 --- a/go/vt/vtgate/evalengine/cached_size.go +++ b/go/vt/vtgate/evalengine/cached_size.go @@ -2068,6 +2068,16 @@ func (cached *evalUint64) CachedSize(alloc bool) int64 { } return size } +func (cached *evalYear) CachedSize(alloc bool) int64 { + if cached == nil { + return int64(0) + } + size := int64(0) + if alloc { + size += int64(16) + } + return size +} func (cached *typedExpr) CachedSize(alloc bool) int64 { if cached == nil { return int64(0) From 0f4b6353ee65782ab73d3345f825581f56ce645b Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Tue, 23 Jul 2024 13:53:01 +0200 Subject: [PATCH 7/8] Fix capability checks Signed-off-by: Dirkjan Bussink --- go/mysql/capabilities/capability.go | 6 +++++ go/mysql/flavor.go | 10 +++---- go/mysql/flavor_filepos.go | 26 +++++++++---------- go/mysql/flavor_mysqlgr.go | 4 +-- go/vt/binlog/binlogplayer/dbclient.go | 7 ++--- go/vt/binlog/binlogplayer/fake_dbclient.go | 6 ++--- go/vt/binlog/binlogplayer/mock_dbclient.go | 6 ++--- .../tabletmanager/vdiff/framework_test.go | 5 ++-- .../vreplication/framework_test.go | 5 ++-- .../tabletmanager/vreplication/vreplicator.go | 5 +++- .../vreplication/vreplicator_test.go | 5 +--- go/vt/wrangler/fake_dbclient_test.go | 9 +++---- 12 files changed, 51 insertions(+), 43 deletions(-) diff --git a/go/mysql/capabilities/capability.go b/go/mysql/capabilities/capability.go index 234707538ec..be574724f0f 100644 --- a/go/mysql/capabilities/capability.go +++ b/go/mysql/capabilities/capability.go @@ -48,6 +48,8 @@ const ( PerformanceSchemaDataLocksTableCapability // supported in MySQL 8.0.1 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html InstantDDLXtrabackupCapability // Supported in 8.0.32 and above, solving a MySQL-vs-Xtrabackup bug starting 8.0.29 ReplicaTerminologyCapability // Supported in 8.0.26 and above, using SHOW REPLICA STATUS and all variations. + BinaryLogStatus // Supported in 8.2.0 and above, uses SHOW BINARY LOG STATUS + RestrictFKOnNonStandardKey // Supported in 8.4.0 and above, restricts usage of non-standard indexes for foreign keys. ) type CapableOf func(capability FlavorCapability) (bool, error) @@ -119,6 +121,10 @@ func MySQLVersionHasCapability(serverVersion string, capability FlavorCapability // So be conservative here, and only use the new syntax on newer versions, // so we don't have to have too many different flavors. return atLeast(8, 0, 26) + case BinaryLogStatus: + return atLeast(8, 2, 0) + case RestrictFKOnNonStandardKey: + return atLeast(8, 4, 0) default: return false, nil } diff --git a/go/mysql/flavor.go b/go/mysql/flavor.go index f732b1ccb88..a0f9e8cc4b1 100644 --- a/go/mysql/flavor.go +++ b/go/mysql/flavor.go @@ -158,7 +158,7 @@ type flavor interface { // flavorFuncs maps flavor names to their implementation. // Flavors need to register only if they support being specified in the // connection parameters. -var flavorFuncs = make(map[string]func() flavor) +var flavorFuncs = make(map[string]func(serverVersion string) flavor) // GetFlavor fills in c.Flavor. If the params specify the flavor, // that is used. Otherwise, we auto-detect. @@ -172,11 +172,11 @@ var flavorFuncs = make(map[string]func() flavor) // Note on such servers, 'select version()' would return 10.0.21-MariaDB-... // as well (not matching what c.ServerVersion is, but matching after we remove // the prefix). -func GetFlavor(serverVersion string, flavorFunc func() flavor) (f flavor, capableOf capabilities.CapableOf, canonicalVersion string) { +func GetFlavor(serverVersion string, flavorFunc func(serverVersion string) flavor) (f flavor, capableOf capabilities.CapableOf, canonicalVersion string) { canonicalVersion = serverVersion switch { case flavorFunc != nil: - f = flavorFunc() + f = flavorFunc(serverVersion) case strings.HasPrefix(serverVersion, mariaDBReplicationHackPrefix): canonicalVersion = serverVersion[len(mariaDBReplicationHackPrefix):] f = mariadbFlavor101{mariadbFlavor{serverVersion: canonicalVersion}} @@ -282,7 +282,7 @@ func (c *Conn) GetServerUUID() (string, error) { // PrimaryFilePosition returns the current primary's file based replication position. func (c *Conn) PrimaryFilePosition() (replication.Position, error) { - filePosFlavor := filePosFlavor{} + filePosFlavor := filePosFlavor{serverVersion: c.ServerVersion} gtidSet, err := filePosFlavor.primaryGTIDSet(c) if err != nil { return replication.Position{}, err @@ -440,7 +440,7 @@ func (c *Conn) CatchupToGTIDCommands(params *ConnParams, pos replication.Positio // the context expires for the file position flavor. It returns an error if // we did not succeed. func (c *Conn) WaitUntilFilePosition(ctx context.Context, pos replication.Position) error { - filePosFlavor := filePosFlavor{} + filePosFlavor := filePosFlavor{serverVersion: c.ServerVersion} return filePosFlavor.waitUntilPosition(ctx, c, pos) } diff --git a/go/mysql/flavor_filepos.go b/go/mysql/flavor_filepos.go index 4ee13eb6c01..565aa2a807d 100644 --- a/go/mysql/flavor_filepos.go +++ b/go/mysql/flavor_filepos.go @@ -32,21 +32,21 @@ import ( ) type filePosFlavor struct { - format BinlogFormat - file string - savedEvent BinlogEvent + format BinlogFormat + file string + savedEvent BinlogEvent + serverVersion string } // newFilePosFlavor creates a new filePos flavor. -func newFilePosFlavor() flavor { - return &filePosFlavor{} +func newFilePosFlavor(serverVersion string) flavor { + return &filePosFlavor{serverVersion: serverVersion} } // primaryGTIDSet is part of the Flavor interface. func (flv *filePosFlavor) primaryGTIDSet(c *Conn) (replication.GTIDSet, error) { query := "SHOW MASTER STATUS" - capability, _ := capabilities.ServerVersionAtLeast(c.ServerVersion, 8, 4, 0) - if capability { + if ok, err := c.SupportsCapability(capabilities.BinaryLogStatus); err == nil && ok { query = "SHOW BINARY LOG STATUS" } @@ -300,11 +300,9 @@ func (flv *filePosFlavor) waitUntilPosition(ctx context.Context, c *Conn, pos re queryPos := "SELECT MASTER_POS_WAIT('%s', %d)" queryPosSub := "SELECT MASTER_POS_WAIT('%s', %d, %.6f)" - if capableOf := capabilities.MySQLVersionCapableOf(c.ServerVersion); capableOf != nil { - if ok, _ := capableOf(capabilities.ReplicaTerminologyCapability); ok { - queryPos = "SELECT SOURCE_POS_WAIT('%s', %d)" - queryPosSub = "SELECT SOURCE_POS_WAIT('%s', %d, %.6f)" - } + if ok, err := c.SupportsCapability(capabilities.ReplicaTerminologyCapability); err == nil && ok { + queryPos = "SELECT SOURCE_POS_WAIT('%s', %d)" + queryPosSub = "SELECT SOURCE_POS_WAIT('%s', %d, %.6f)" } query := fmt.Sprintf(queryPos, filePosPos.File, filePosPos.Pos) @@ -369,8 +367,10 @@ func (*filePosFlavor) baseShowTablesWithSizes() string { } // supportsCapability is part of the Flavor interface. -func (*filePosFlavor) supportsCapability(capability capabilities.FlavorCapability) (bool, error) { +func (f *filePosFlavor) supportsCapability(capability capabilities.FlavorCapability) (bool, error) { switch capability { + case capabilities.BinaryLogStatus: + return capabilities.ServerVersionAtLeast(f.serverVersion, 8, 2, 0) default: return false, nil } diff --git a/go/mysql/flavor_mysqlgr.go b/go/mysql/flavor_mysqlgr.go index df3dc060742..98516e9cc9f 100644 --- a/go/mysql/flavor_mysqlgr.go +++ b/go/mysql/flavor_mysqlgr.go @@ -42,8 +42,8 @@ type mysqlGRFlavor struct { } // newMysqlGRFlavor creates a new mysqlGR flavor. -func newMysqlGRFlavor() flavor { - return &mysqlGRFlavor{} +func newMysqlGRFlavor(serverVersion string) flavor { + return &mysqlGRFlavor{mysqlFlavor{serverVersion: serverVersion}} } // startReplicationCommand returns the command to start the replication. diff --git a/go/vt/binlog/binlogplayer/dbclient.go b/go/vt/binlog/binlogplayer/dbclient.go index 89de8bdc6b0..c3463b4cc2c 100644 --- a/go/vt/binlog/binlogplayer/dbclient.go +++ b/go/vt/binlog/binlogplayer/dbclient.go @@ -23,6 +23,7 @@ import ( "vitess.io/vitess/go/constants/sidecar" "vitess.io/vitess/go/mysql" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/mysql/sqlerror" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" @@ -41,7 +42,7 @@ type DBClient interface { Close() ExecuteFetch(query string, maxrows int) (qr *sqltypes.Result, err error) ExecuteFetchMulti(query string, maxrows int) (qrs []*sqltypes.Result, err error) - ServerVersion() string + SupportsCapability(capability capabilities.FlavorCapability) (bool, error) } // dbClientImpl is a real DBClient backed by a mysql connection. @@ -124,8 +125,8 @@ func (dc *dbClientImpl) Close() { dc.dbConn.Close() } -func (dc *dbClientImpl) ServerVersion() string { - return dc.dbConn.ServerVersion +func (dc *dbClientImpl) SupportsCapability(capability capabilities.FlavorCapability) (bool, error) { + return dc.dbConn.SupportsCapability(capability) } // LogError logs a message after truncating it to avoid spamming logs diff --git a/go/vt/binlog/binlogplayer/fake_dbclient.go b/go/vt/binlog/binlogplayer/fake_dbclient.go index 2885479cdbc..234dfd528e0 100644 --- a/go/vt/binlog/binlogplayer/fake_dbclient.go +++ b/go/vt/binlog/binlogplayer/fake_dbclient.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "vitess.io/vitess/go/mysql/config" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/sqltypes" ) @@ -86,6 +86,6 @@ func (dc *fakeDBClient) ExecuteFetchMulti(query string, maxrows int) ([]*sqltype return make([]*sqltypes.Result, 0), nil } -func (dc *fakeDBClient) ServerVersion() string { - return config.DefaultMySQLVersion +func (dc *fakeDBClient) SupportsCapability(capability capabilities.FlavorCapability) (bool, error) { + return false, nil } diff --git a/go/vt/binlog/binlogplayer/mock_dbclient.go b/go/vt/binlog/binlogplayer/mock_dbclient.go index 09fa19ac559..c27ae02ebaf 100644 --- a/go/vt/binlog/binlogplayer/mock_dbclient.go +++ b/go/vt/binlog/binlogplayer/mock_dbclient.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "vitess.io/vitess/go/mysql/config" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/sqlparser" ) @@ -262,6 +262,6 @@ func (dc *MockDBClient) RemoveInvariant(query string) { delete(dc.invariants, query) } -func (dc *MockDBClient) ServerVersion() string { - return config.DefaultMySQLVersion +func (dc *MockDBClient) SupportsCapability(capability capabilities.FlavorCapability) (bool, error) { + return false, nil } diff --git a/go/vt/vttablet/tabletmanager/vdiff/framework_test.go b/go/vt/vttablet/tabletmanager/vdiff/framework_test.go index 4b658fb3afd..8df060e4170 100644 --- a/go/vt/vttablet/tabletmanager/vdiff/framework_test.go +++ b/go/vt/vttablet/tabletmanager/vdiff/framework_test.go @@ -30,6 +30,7 @@ import ( "github.com/stretchr/testify/require" "vitess.io/vitess/go/mysql" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/binlog/binlogplayer" "vitess.io/vitess/go/vt/grpcclient" @@ -422,8 +423,8 @@ func (dbc *realDBClient) ExecuteFetchMulti(query string, maxrows int) ([]*sqltyp return results, nil } -func (dbc *realDBClient) ServerVersion() string { - return dbc.conn.ServerVersion +func (dbc *realDBClient) SupportsCapability(capability capabilities.FlavorCapability) (bool, error) { + return dbc.conn.SupportsCapability(capability) } //---------------------------------------------- diff --git a/go/vt/vttablet/tabletmanager/vreplication/framework_test.go b/go/vt/vttablet/tabletmanager/vreplication/framework_test.go index 978322fd7e5..ef80dd49757 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/framework_test.go +++ b/go/vt/vttablet/tabletmanager/vreplication/framework_test.go @@ -34,6 +34,7 @@ import ( _flag "vitess.io/vitess/go/internal/flag" "vitess.io/vitess/go/mysql" + "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/mysql/replication" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/test/utils" @@ -509,8 +510,8 @@ func (dbc *realDBClient) ExecuteFetchMulti(query string, maxrows int) ([]*sqltyp return results, nil } -func (dbc *realDBClient) ServerVersion() string { - return dbc.conn.ServerVersion +func (dbc *realDBClient) SupportsCapability(capability capabilities.FlavorCapability) (bool, error) { + return dbc.conn.SupportsCapability(capability) } func expectDeleteQueries(t *testing.T) { diff --git a/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go b/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go index 4e9e31c3ca7..abeda52b047 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go @@ -527,7 +527,10 @@ func (vr *vreplicator) getSettingFKCheck() error { } func (vr *vreplicator) needFKRestrict() bool { - ok, _ := capabilities.ServerVersionAtLeast(vr.dbClient.ServerVersion(), 8, 4, 0) + ok, err := vr.dbClient.SupportsCapability(capabilities.RestrictFKOnNonStandardKey) + if err != nil { + return false + } return ok } diff --git a/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go b/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go index e559939c9d3..f6eb3ac5958 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go @@ -31,7 +31,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/vt/binlog/binlogplayer" "vitess.io/vitess/go/vt/dbconfigs" "vitess.io/vitess/go/vt/mysqlctl" @@ -482,9 +481,7 @@ func TestDeferSecondaryKeys(t *testing.T) { } // Create the table. - capability, err := capabilities.ServerVersionAtLeast(dbClient.ServerVersion(), 8, 4, 0) - require.NoError(t, err) - if capability { + if vr.needFKRestrict() { _, err := dbClient.ExecuteFetch("set @@session.restrict_fk_on_non_standard_key=0", 1) require.NoError(t, err) defer func() { diff --git a/go/vt/wrangler/fake_dbclient_test.go b/go/vt/wrangler/fake_dbclient_test.go index 80d0b25da73..14ef0913383 100644 --- a/go/vt/wrangler/fake_dbclient_test.go +++ b/go/vt/wrangler/fake_dbclient_test.go @@ -25,11 +25,10 @@ import ( "github.com/stretchr/testify/assert" - "vitess.io/vitess/go/mysql/config" + "vitess.io/vitess/go/mysql/capabilities" + "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/sqlparser" - - "vitess.io/vitess/go/sqltypes" ) func verifyQueries(t *testing.T, dcs []*fakeDBClient) { @@ -178,8 +177,8 @@ func (dc *fakeDBClient) ExecuteFetchMulti(query string, maxrows int) ([]*sqltype return results, nil } -func (dc *fakeDBClient) ServerVersion() string { - return config.DefaultMySQLVersion +func (dc *fakeDBClient) SupportsCapability(capability capabilities.FlavorCapability) (bool, error) { + return false, nil } // ExecuteFetch is part of the DBClient interface From e0051205d39f8146de429523f645c3bf7af35c15 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Tue, 23 Jul 2024 14:57:57 +0200 Subject: [PATCH 8/8] Remove MAKETIME case Signed-off-by: Dirkjan Bussink --- go/vt/vtgate/evalengine/compiler_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/go/vt/vtgate/evalengine/compiler_test.go b/go/vt/vtgate/evalengine/compiler_test.go index 73646f45a6c..04eb72ad4f2 100644 --- a/go/vt/vtgate/evalengine/compiler_test.go +++ b/go/vt/vtgate/evalengine/compiler_test.go @@ -723,10 +723,6 @@ func TestCompilerSingle(t *testing.T) { expression: `cast(_utf32 0x0000FF as binary)`, result: `VARBINARY("\x00\x00\x00\xff")`, }, - { - expression: `MAKETIME(-9223372036854775808, '3', 1.5)`, - result: `TIME("-00:03:01.5")`, - }, } tz, _ := time.LoadLocation("Europe/Madrid")