diff --git a/.github/workflows/assign_milestone.yml b/.github/workflows/assign_milestone.yml index 443d28e80d6..9f4ca13d1c7 100644 --- a/.github/workflows/assign_milestone.yml +++ b/.github/workflows/assign_milestone.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/check_make_vtadmin_authz_testgen.yml b/.github/workflows/check_make_vtadmin_authz_testgen.yml index 3502c973632..5383052c28b 100644 --- a/.github/workflows/check_make_vtadmin_authz_testgen.yml +++ b/.github/workflows/check_make_vtadmin_authz_testgen.yml @@ -50,7 +50,7 @@ jobs: uses: actions/setup-go@v5 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true' with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true' diff --git a/.github/workflows/check_make_vtadmin_web_proto.yml b/.github/workflows/check_make_vtadmin_web_proto.yml index 61c83168c23..19dc4691bbb 100644 --- a/.github/workflows/check_make_vtadmin_web_proto.yml +++ b/.github/workflows/check_make_vtadmin_web_proto.yml @@ -52,7 +52,7 @@ jobs: uses: actions/setup-go@v5 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true' with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Setup Node if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true' diff --git a/.github/workflows/cluster_endtoend_12.yml b/.github/workflows/cluster_endtoend_12.yml index 3c984f4d403..c817948c1a1 100644 --- a/.github/workflows/cluster_endtoend_12.yml +++ b/.github/workflows/cluster_endtoend_12.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_13.yml b/.github/workflows/cluster_endtoend_13.yml index c1a92a8a4b7..3fdbed40034 100644 --- a/.github/workflows/cluster_endtoend_13.yml +++ b/.github/workflows/cluster_endtoend_13.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_15.yml b/.github/workflows/cluster_endtoend_15.yml index 3d2881b7676..1a5b0bdbc80 100644 --- a/.github/workflows/cluster_endtoend_15.yml +++ b/.github/workflows/cluster_endtoend_15.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_18.yml b/.github/workflows/cluster_endtoend_18.yml index 1f35fbf0431..82004417dfa 100644 --- a/.github/workflows/cluster_endtoend_18.yml +++ b/.github/workflows/cluster_endtoend_18.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_21.yml b/.github/workflows/cluster_endtoend_21.yml index d47ad86dfd1..9da4da5fc4b 100644 --- a/.github/workflows/cluster_endtoend_21.yml +++ b/.github/workflows/cluster_endtoend_21.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_backup_pitr.yml b/.github/workflows/cluster_endtoend_backup_pitr.yml index 560b3029158..d2509ff82a2 100644 --- a/.github/workflows/cluster_endtoend_backup_pitr.yml +++ b/.github/workflows/cluster_endtoend_backup_pitr.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml b/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml index 1891d1a75d2..e5566dfb3c7 100644 --- a/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml +++ b/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml index a3f41d78264..84b6f9fc8f8 100644 --- a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml +++ b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_mysql80.yml b/.github/workflows/cluster_endtoend_mysql80.yml index f5dc2abad55..1ccc618c9ba 100644 --- a/.github/workflows/cluster_endtoend_mysql80.yml +++ b/.github/workflows/cluster_endtoend_mysql80.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_mysql_server_vault.yml b/.github/workflows/cluster_endtoend_mysql_server_vault.yml index d41b6f014f5..52351122bb1 100644 --- a/.github/workflows/cluster_endtoend_mysql_server_vault.yml +++ b/.github/workflows/cluster_endtoend_mysql_server_vault.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert.yml b/.github/workflows/cluster_endtoend_onlineddl_revert.yml index 10e6c4e670f..7db77d8a533 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert.yml @@ -74,7 +74,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml index 4b76d62b923..1df14eb21ff 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml @@ -74,7 +74,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml index f2e7d2939f0..e458064073a 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml @@ -74,7 +74,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml index 7574a4bcea2..7a0a840677b 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml @@ -74,7 +74,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml index c6576ed2927..41ffa0991c5 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml @@ -74,7 +74,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml index ce528f797ea..0c9fbc9878a 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml @@ -74,7 +74,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml index 07224c415db..47c9708a5bd 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml @@ -74,7 +74,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml index e80c8598f44..aac6706c488 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml index 14973bd1f2d..4991d6f2e04 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml b/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml index a647e443e61..715968bbcd6 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_topo_connection_cache.yml b/.github/workflows/cluster_endtoend_topo_connection_cache.yml index 37c932621d9..52ffc7bbb44 100644 --- a/.github/workflows/cluster_endtoend_topo_connection_cache.yml +++ b/.github/workflows/cluster_endtoend_topo_connection_cache.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml index 9116e1d3fc2..695f00c5fc6 100644 --- a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml +++ b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vreplication_basic.yml b/.github/workflows/cluster_endtoend_vreplication_basic.yml index 7843ad05192..ac6fe7e8142 100644 --- a/.github/workflows/cluster_endtoend_vreplication_basic.yml +++ b/.github/workflows/cluster_endtoend_vreplication_basic.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml index 9a179229f1e..d0779a65104 100644 --- a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml +++ b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vreplication_copy_parallel.yml b/.github/workflows/cluster_endtoend_vreplication_copy_parallel.yml index 37eafd948c4..3483aca73ef 100644 --- a/.github/workflows/cluster_endtoend_vreplication_copy_parallel.yml +++ b/.github/workflows/cluster_endtoend_vreplication_copy_parallel.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml b/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml index 9fb4287e0b1..b48f1c6525d 100644 --- a/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml +++ b/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vreplication_mariadb_to_mysql.yml b/.github/workflows/cluster_endtoend_vreplication_mariadb_to_mysql.yml index 86f2fa69e30..c31376b31b0 100644 --- a/.github/workflows/cluster_endtoend_vreplication_mariadb_to_mysql.yml +++ b/.github/workflows/cluster_endtoend_vreplication_mariadb_to_mysql.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 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 d7d385f1e9f..d3e50cbf85c 100644 --- a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml +++ b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vreplication_multi_tenant.yml b/.github/workflows/cluster_endtoend_vreplication_multi_tenant.yml index e4e5ee17452..076fa0ad638 100644 --- a/.github/workflows/cluster_endtoend_vreplication_multi_tenant.yml +++ b/.github/workflows/cluster_endtoend_vreplication_multi_tenant.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 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 a7b2c31b420..e7a57c2a4f8 100644 --- a/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml +++ b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vreplication_v2.yml b/.github/workflows/cluster_endtoend_vreplication_v2.yml index fb1247fabfb..f90635ea7da 100644 --- a/.github/workflows/cluster_endtoend_vreplication_v2.yml +++ b/.github/workflows/cluster_endtoend_vreplication_v2.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vstream.yml b/.github/workflows/cluster_endtoend_vstream.yml index 5d13e6d3a41..ac5ed9e50f3 100644 --- a/.github/workflows/cluster_endtoend_vstream.yml +++ b/.github/workflows/cluster_endtoend_vstream.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtbackup.yml b/.github/workflows/cluster_endtoend_vtbackup.yml index 9bf411cc328..c01f83f2311 100644 --- a/.github/workflows/cluster_endtoend_vtbackup.yml +++ b/.github/workflows/cluster_endtoend_vtbackup.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml index 09fbfa8e451..6df364a865a 100644 --- a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml index b8cb2d77ad9..5bba59c99d0 100644 --- a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml +++ b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml b/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml index 5ad1025debd..710f89c1cfe 100644 --- a/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml +++ b/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_gen4.yml b/.github/workflows/cluster_endtoend_vtgate_gen4.yml index 43bbe666186..81b3e660583 100644 --- a/.github/workflows/cluster_endtoend_vtgate_gen4.yml +++ b/.github/workflows/cluster_endtoend_vtgate_gen4.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml index d63edf72ae7..612ca4d9c37 100644 --- a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_godriver.yml b/.github/workflows/cluster_endtoend_vtgate_godriver.yml index c7c2d0bf494..7eb96d4e44d 100644 --- a/.github/workflows/cluster_endtoend_vtgate_godriver.yml +++ b/.github/workflows/cluster_endtoend_vtgate_godriver.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml b/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml index 3510e8f2144..5fb7efaabef 100644 --- a/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml +++ b/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_queries.yml b/.github/workflows/cluster_endtoend_vtgate_queries.yml index 40f20e2177e..021688b4535 100644 --- a/.github/workflows/cluster_endtoend_vtgate_queries.yml +++ b/.github/workflows/cluster_endtoend_vtgate_queries.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml index c913e05810a..9e4d9edcd41 100644 --- a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml +++ b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml index aa173b32ca3..52b282a77e0 100644 --- a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml +++ b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_schema.yml b/.github/workflows/cluster_endtoend_vtgate_schema.yml index 5a5ab725b8a..544bec6f765 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml index 00244b8223a..570300833dd 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml index ee14848cd79..00f164426fd 100644 --- a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml +++ b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_topo.yml b/.github/workflows/cluster_endtoend_vtgate_topo.yml index 9517ad965b5..118a2c45558 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml index 6d585fb41f3..8d6ae8f635a 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml index d1ae0e96afd..15e5636ee1c 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_transaction.yml b/.github/workflows/cluster_endtoend_vtgate_transaction.yml index 50f6a57b551..327fc33bfd2 100644 --- a/.github/workflows/cluster_endtoend_vtgate_transaction.yml +++ b/.github/workflows/cluster_endtoend_vtgate_transaction.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml index b0d8348aaab..4ceac1d1daa 100644 --- a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml +++ b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml index 330ee506517..01d19586569 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtgate_vschema.yml b/.github/workflows/cluster_endtoend_vtgate_vschema.yml index 4ddf20fa9c5..7fdcc77bd1d 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vschema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vschema.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vtorc.yml b/.github/workflows/cluster_endtoend_vtorc.yml index 77493692395..46472a196a9 100644 --- a/.github/workflows/cluster_endtoend_vtorc.yml +++ b/.github/workflows/cluster_endtoend_vtorc.yml @@ -82,7 +82,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml b/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml index 58ff4074c0c..9df6188734a 100644 --- a/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml +++ b/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_xb_backup.yml b/.github/workflows/cluster_endtoend_xb_backup.yml index 5a8acc66d8c..e9f9681583f 100644 --- a/.github/workflows/cluster_endtoend_xb_backup.yml +++ b/.github/workflows/cluster_endtoend_xb_backup.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/cluster_endtoend_xb_recovery.yml b/.github/workflows/cluster_endtoend_xb_recovery.yml index 94fb11320fb..52cd553b86f 100644 --- a/.github/workflows/cluster_endtoend_xb_recovery.yml +++ b/.github/workflows/cluster_endtoend_xb_recovery.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 3015309d2c2..2f938e53365 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -32,7 +32,7 @@ jobs: if: steps.changes.outputs.changed_files == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.changes.outputs.changed_files == 'true' diff --git a/.github/workflows/codeql_analysis.yml b/.github/workflows/codeql_analysis.yml index d6d5ea6335d..1db6be33985 100644 --- a/.github/workflows/codeql_analysis.yml +++ b/.github/workflows/codeql_analysis.yml @@ -32,7 +32,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index cb393141ae3..adbc3350600 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Setup node uses: actions/setup-node@v4 diff --git a/.github/workflows/docker_test_cluster_10.yml b/.github/workflows/docker_test_cluster_10.yml index 2a1c1050461..91e01b0f4f4 100644 --- a/.github/workflows/docker_test_cluster_10.yml +++ b/.github/workflows/docker_test_cluster_10.yml @@ -54,7 +54,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/docker_test_cluster_25.yml b/.github/workflows/docker_test_cluster_25.yml index ba73f50252b..f30f38f1700 100644 --- a/.github/workflows/docker_test_cluster_25.yml +++ b/.github/workflows/docker_test_cluster_25.yml @@ -54,7 +54,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/e2e_race.yml b/.github/workflows/e2e_race.yml index 7819ab3ae90..7d81948fbc2 100644 --- a/.github/workflows/e2e_race.yml +++ b/.github/workflows/e2e_race.yml @@ -52,7 +52,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/endtoend.yml b/.github/workflows/endtoend.yml index 783d3305fc8..3703bdd0e5c 100644 --- a/.github/workflows/endtoend.yml +++ b/.github/workflows/endtoend.yml @@ -52,7 +52,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/local_example.yml b/.github/workflows/local_example.yml index 851db91df22..4711e764854 100644 --- a/.github/workflows/local_example.yml +++ b/.github/workflows/local_example.yml @@ -57,7 +57,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' diff --git a/.github/workflows/region_example.yml b/.github/workflows/region_example.yml index b10abe415d7..bfcb5a66752 100644 --- a/.github/workflows/region_example.yml +++ b/.github/workflows/region_example.yml @@ -57,7 +57,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' diff --git a/.github/workflows/static_checks_etc.yml b/.github/workflows/static_checks_etc.yml index 75fb01e487e..5f04992ea09 100644 --- a/.github/workflows/static_checks_etc.yml +++ b/.github/workflows/static_checks_etc.yml @@ -123,7 +123,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && (steps.changes.outputs.go_files == 'true' || steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.proto_changes == 'true') uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' @@ -193,7 +193,7 @@ jobs: - name: Install golangci-lint if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' - run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 + run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1 - name: Clean Env if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' diff --git a/.github/workflows/unit_race.yml b/.github/workflows/unit_race.yml index 3f6de3eb6f8..8c7f5282987 100644 --- a/.github/workflows/unit_race.yml +++ b/.github/workflows/unit_race.yml @@ -69,7 +69,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/.github/workflows/unit_race_evalengine.yml b/.github/workflows/unit_race_evalengine.yml index 77ada6729bd..71b22d53ef5 100644 --- a/.github/workflows/unit_race_evalengine.yml +++ b/.github/workflows/unit_race_evalengine.yml @@ -69,7 +69,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/.github/workflows/unit_test_evalengine_mysql57.yml b/.github/workflows/unit_test_evalengine_mysql57.yml index 313e076177c..3aa74c3b77e 100644 --- a/.github/workflows/unit_test_evalengine_mysql57.yml +++ b/.github/workflows/unit_test_evalengine_mysql57.yml @@ -71,7 +71,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/.github/workflows/unit_test_evalengine_mysql80.yml b/.github/workflows/unit_test_evalengine_mysql80.yml index a19087f6f29..8af77e812fa 100644 --- a/.github/workflows/unit_test_evalengine_mysql80.yml +++ b/.github/workflows/unit_test_evalengine_mysql80.yml @@ -71,7 +71,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/.github/workflows/unit_test_evalengine_mysql84.yml b/.github/workflows/unit_test_evalengine_mysql84.yml index be066cc5bb1..cc0281f4ec9 100644 --- a/.github/workflows/unit_test_evalengine_mysql84.yml +++ b/.github/workflows/unit_test_evalengine_mysql84.yml @@ -71,7 +71,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/.github/workflows/unit_test_mysql57.yml b/.github/workflows/unit_test_mysql57.yml index 1ccf3e320a9..64bc537e046 100644 --- a/.github/workflows/unit_test_mysql57.yml +++ b/.github/workflows/unit_test_mysql57.yml @@ -71,7 +71,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/.github/workflows/unit_test_mysql80.yml b/.github/workflows/unit_test_mysql80.yml index 1984d36a5a9..950eb573867 100644 --- a/.github/workflows/unit_test_mysql80.yml +++ b/.github/workflows/unit_test_mysql80.yml @@ -71,7 +71,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/.github/workflows/unit_test_mysql84.yml b/.github/workflows/unit_test_mysql84.yml index f3fab513358..9a94a5a6765 100644 --- a/.github/workflows/unit_test_mysql84.yml +++ b/.github/workflows/unit_test_mysql84.yml @@ -71,7 +71,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/.github/workflows/update_golang_dependencies.yml b/.github/workflows/update_golang_dependencies.yml index 7538090d51e..12b8c30ab9c 100644 --- a/.github/workflows/update_golang_dependencies.yml +++ b/.github/workflows/update_golang_dependencies.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Check out code uses: actions/checkout@v4 diff --git a/.github/workflows/update_golang_version.yml b/.github/workflows/update_golang_version.yml index df9677e7cf4..d041909403a 100644 --- a/.github/workflows/update_golang_version.yml +++ b/.github/workflows/update_golang_version.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Check out code uses: actions/checkout@v4 diff --git a/.github/workflows/upgrade_downgrade_test_backups_e2e.yml b/.github/workflows/upgrade_downgrade_test_backups_e2e.yml index e8b8a688879..f2078df3f32 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_e2e.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_e2e.yml @@ -72,7 +72,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.22.6 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml b/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml index 0e24c534057..ba1e9683162 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml @@ -74,7 +74,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual.yml b/.github/workflows/upgrade_downgrade_test_backups_manual.yml index 9c98b643c3e..c6e68bac253 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual.yml @@ -76,7 +76,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.22.6 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 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 1cdfcee1fec..45485bfa928 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml @@ -77,7 +77,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml b/.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml index c32a24ab083..81759c99665 100644 --- a/.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml +++ b/.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml @@ -83,7 +83,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.22.6 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml index 36fc151bba6..f08b77f9110 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml @@ -75,7 +75,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.22.6 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 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 03c9212f449..764ce3d3938 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 @@ -76,7 +76,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml index 1006179a97a..f33506a902b 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml @@ -75,7 +75,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.22.6 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 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 1c30fe53c2f..ac5fbe747f1 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 @@ -76,7 +76,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml index 853dd172ff6..1851c590ea6 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml @@ -76,7 +76,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml index 90c41d4ee09..59c97db189f 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml @@ -76,7 +76,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml index 7008f07ce44..39386afdd4c 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml @@ -75,7 +75,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.22.6 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml index e1240dd9a13..3c7f6e71d03 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml @@ -75,7 +75,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.22.6 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/upgrade_downgrade_test_semi_sync.yml b/.github/workflows/upgrade_downgrade_test_semi_sync.yml index 91b3b22b93e..7fa767a1af3 100644 --- a/.github/workflows/upgrade_downgrade_test_semi_sync.yml +++ b/.github/workflows/upgrade_downgrade_test_semi_sync.yml @@ -72,7 +72,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.22.6 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.github/workflows/vitess_tester_vtgate.yml b/.github/workflows/vitess_tester_vtgate.yml index 9e11697f778..dceaf4fca4a 100644 --- a/.github/workflows/vitess_tester_vtgate.yml +++ b/.github/workflows/vitess_tester_vtgate.yml @@ -73,7 +73,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/.golangci.yml b/.golangci.yml index d20e7d1e9fd..e907f56743b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ run: - go: 1.20 + go: 1.23 timeout: 10m linters-settings: @@ -11,7 +11,38 @@ linters-settings: - pkg: "math/rand$" desc: Please use math/rand/v2 errcheck: - exclude: ./misc/errcheck_excludes.txt + exclude-functions: + - flag.Set + - (*flag.FlagSet).Parse + - (flag.Value).Set + - fmt.Fprint + - fmt.Fprintf + - io.WriteString(fmt.State) + - io.WriteString(net/http.ResponseWriter) + - (net.Listener).Close + - (net/http.ResponseWriter).Write + - (*os.File).Close + - os.Remove + - os.RemoveAll + - os.Rename + - (*github.com/spf13/cobra.Command).Help + - (*github.com/spf13/cobra.Command).MarkFlagRequired + - (*github.com/spf13/cobra.Command).MarkPersistentFlagRequired + - (*github.com/spf13/cobra.Command).MarkPersistentFlagFilename + - (*github.com/spf13/pflag.FlagSet).MarkDeprecated + - (*google.golang.org/grpc.ClientConn).Close + - (*google.golang.org/grpc.Server).Serve + - (*vitess.io/vitess/go/bytes2.Buffer).Write + - (*vitess.io/vitess/go/bytes2.Buffer).WriteByte + - (*vitess.io/vitess/go/bytes2.Buffer).WriteString + - (vitess.io/vitess/go/sqltypes.BinWriter).Write + - vitess.io/vitess/go/vt/orchestrator/external/golib/log.Errore + - vitess.io/vitess/go/vt/orchestrator/external/golib/log.Errorf + - vitess.io/vitess/go/vt/orchestrator/external/golib/log.Fatal + - vitess.io/vitess/go/vt/orchestrator/external/golib/log.Fatale + - vitess.io/vitess/go/vt/orchestrator/external/golib/log.Fatalf + - (*vitess.io/vitess/go/vt/vttest.LocalCluster).TearDown + goimports: local-prefixes: vitess.io/vitess govet: diff --git a/Makefile b/Makefile index ab367408873..219139af796 100644 --- a/Makefile +++ b/Makefile @@ -286,7 +286,7 @@ $(PROTO_GO_OUTS): minimaltools install_protoc-gen-go proto/*.proto # This rule builds the bootstrap images for all flavors. DOCKER_IMAGES_FOR_TEST = mysql57 mysql80 percona57 percona80 DOCKER_IMAGES = common $(DOCKER_IMAGES_FOR_TEST) -BOOTSTRAP_VERSION=34 +BOOTSTRAP_VERSION=35 ensure_bootstrap_version: find docker/ -type f -exec sed -i "s/^\(ARG bootstrap_version\)=.*/\1=${BOOTSTRAP_VERSION}/" {} \; sed -i 's/\(^.*flag.String(\"bootstrap-version\",\) *\"[^\"]\+\"/\1 \"${BOOTSTRAP_VERSION}\"/' test.go diff --git a/build.env b/build.env index ba741be4211..cfddc55c11f 100755 --- a/build.env +++ b/build.env @@ -17,7 +17,7 @@ source ./tools/shell_functions.inc go version >/dev/null 2>&1 || fail "Go is not installed or is not in \$PATH. See https://vitess.io/contributing/build-from-source for install instructions." -goversion_min 1.22.5 || echo "Go version reported: `go version`. Version 1.22.5+ recommended. See https://vitess.io/contributing/build-from-source for install instructions." +goversion_min 1.23.0 || echo "Go version reported: `go version`. Version 1.23.0+ recommended. See https://vitess.io/contributing/build-from-source for install instructions." mkdir -p dist mkdir -p bin diff --git a/docker/bootstrap/CHANGELOG.md b/docker/bootstrap/CHANGELOG.md index dd9d1c19f17..ee400664a8b 100644 --- a/docker/bootstrap/CHANGELOG.md +++ b/docker/bootstrap/CHANGELOG.md @@ -132,4 +132,8 @@ List of changes between bootstrap image versions. ## [34] - 2024-07-02 ### Changes -- Update build to golang 1.22.5 \ No newline at end of file +- Update build to golang 1.22.5 + +## [35] - 2024-08-14 +### Changes +- Update build to golang 1.23.0 \ No newline at end of file diff --git a/docker/bootstrap/Dockerfile.common b/docker/bootstrap/Dockerfile.common index c48a485bec3..f98d4628ea4 100644 --- a/docker/bootstrap/Dockerfile.common +++ b/docker/bootstrap/Dockerfile.common @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 golang:1.22.5-bullseye +FROM --platform=linux/amd64 golang:1.23.0-bullseye # Install Vitess build dependencies RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ diff --git a/docker/bootstrap/Dockerfile.mysql57 b/docker/bootstrap/Dockerfile.mysql57 index 983f3640472..b840a7b8153 100644 --- a/docker/bootstrap/Dockerfile.mysql57 +++ b/docker/bootstrap/Dockerfile.mysql57 @@ -16,8 +16,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins echo percona-server-server-5.7 percona-server-server/root_password password 'unused'; \ echo percona-server-server-5.7 percona-server-server/root_password_again password 'unused'; \ } | debconf-set-selections && \ - percona-release enable-only tools \ - apt-get update -y && \ + apt-get update -y && apt-get install -y percona-release && \ + percona-release enable-only tools && apt-get update -y && \ DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server libmysqlclient-dev libdbd-mysql-perl rsync libev4 percona-xtrabackup-24 && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/bootstrap/Dockerfile.percona57 b/docker/bootstrap/Dockerfile.percona57 index e9cd5043d44..28a1cd3cb18 100644 --- a/docker/bootstrap/Dockerfile.percona57 +++ b/docker/bootstrap/Dockerfile.percona57 @@ -13,8 +13,7 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --keyserver keyserver.ubuntu.c echo percona-server-server-5.7 percona-server-server/root_password password 'unused'; \ echo percona-server-server-5.7 percona-server-server/root_password_again password 'unused'; \ } | debconf-set-selections && \ - percona-release enable-only tools \ - apt-get update && \ + apt-get update -y && \ apt-get install -y --no-install-recommends percona-server-server-5.7 && \ apt-get install -y --no-install-recommends libperconaserverclient20-dev percona-xtrabackup-24 && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/lite/Dockerfile b/docker/lite/Dockerfile index 7c0b22aed3c..1c7a535ec7a 100644 --- a/docker/lite/Dockerfile +++ b/docker/lite/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM --platform=linux/amd64 golang:1.22.5-bullseye AS builder +FROM --platform=linux/amd64 golang:1.23.0-bullseye AS builder # Allows docker builds to set the BUILD_NUMBER ARG BUILD_NUMBER diff --git a/docker/lite/Dockerfile.percona80 b/docker/lite/Dockerfile.percona80 index cded55438ec..effb1e3e38d 100644 --- a/docker/lite/Dockerfile.percona80 +++ b/docker/lite/Dockerfile.percona80 @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM --platform=linux/amd64 golang:1.22.5-bullseye AS builder +FROM --platform=linux/amd64 golang:1.23.0-bullseye AS builder # Allows docker builds to set the BUILD_NUMBER ARG BUILD_NUMBER diff --git a/docker/vttestserver/Dockerfile.mysql80 b/docker/vttestserver/Dockerfile.mysql80 index 2e79d389c7d..13020ca1509 100644 --- a/docker/vttestserver/Dockerfile.mysql80 +++ b/docker/vttestserver/Dockerfile.mysql80 @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM --platform=linux/amd64 golang:1.22.5-bullseye AS builder +FROM --platform=linux/amd64 golang:1.23.0-bullseye AS builder # Allows docker builds to set the BUILD_NUMBER ARG BUILD_NUMBER diff --git a/go.mod b/go.mod index 1e80e0b9f62..4547fd7e0c0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module vitess.io/vitess -go 1.22.5 +go 1.23 require ( cloud.google.com/go/storage v1.43.0 diff --git a/go/cmd/vtctldclient/command/keyspaces.go b/go/cmd/vtctldclient/command/keyspaces.go index 6330220d773..565e0c8aa82 100644 --- a/go/cmd/vtctldclient/command/keyspaces.go +++ b/go/cmd/vtctldclient/command/keyspaces.go @@ -182,7 +182,7 @@ func commandCreateKeyspace(cmd *cobra.Command, args []string) error { return errors.New("--sidecar-db-name cannot be empty when creating a keyspace") } if len(createKeyspaceOptions.SidecarDBName) > mysql.MaxIdentifierLength { - return sqlerror.NewSQLError(sqlerror.ERTooLongIdent, sqlerror.SSDataTooLong, "--sidecar-db-name identifier value of %q is too long (%d chars), max length for database identifiers is %d characters", + return sqlerror.NewSQLErrorf(sqlerror.ERTooLongIdent, sqlerror.SSDataTooLong, "--sidecar-db-name identifier value of %q is too long (%d chars), max length for database identifiers is %d characters", createKeyspaceOptions.SidecarDBName, len(createKeyspaceOptions.SidecarDBName), mysql.MaxIdentifierLength) } diff --git a/go/cmd/vtctldclient/command/root_test.go b/go/cmd/vtctldclient/command/root_test.go index 5efe844e1a1..86333ec0e69 100644 --- a/go/cmd/vtctldclient/command/root_test.go +++ b/go/cmd/vtctldclient/command/root_test.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "os" - "strings" "testing" "time" @@ -110,9 +109,7 @@ func TestRootWithInternalVtctld(t *testing.T) { err := command.Root.Execute() if tc.expectErr != "" { - if !strings.Contains(err.Error(), tc.expectErr) { - t.Errorf(fmt.Sprintf("%s error = %v, expectErr = %v", tc.command, err, tc.expectErr)) - } + require.ErrorContains(t, err, tc.expectErr) } else { require.NoError(t, err, "unexpected error: %v", err) } diff --git a/go/mysql/auth_server.go b/go/mysql/auth_server.go index f4bda2655a5..64274ef3d66 100644 --- a/go/mysql/auth_server.go +++ b/go/mysql/auth_server.go @@ -428,7 +428,7 @@ func (n *mysqlNativePasswordAuthMethod) AllowClearTextWithoutTLS() bool { func (n *mysqlNativePasswordAuthMethod) HandleAuthPluginData(conn *Conn, user string, serverAuthPluginData []byte, clientAuthPluginData []byte, remoteAddr net.Addr) (Getter, error) { if serverAuthPluginData[len(serverAuthPluginData)-1] != 0x00 { - return nil, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return nil, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } salt := serverAuthPluginData[:len(serverAuthPluginData)-1] @@ -520,7 +520,7 @@ func (n *mysqlCachingSha2AuthMethod) AllowClearTextWithoutTLS() bool { func (n *mysqlCachingSha2AuthMethod) HandleAuthPluginData(c *Conn, user string, serverAuthPluginData []byte, clientAuthPluginData []byte, remoteAddr net.Addr) (Getter, error) { if serverAuthPluginData[len(serverAuthPluginData)-1] != 0x00 { - return nil, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return nil, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } salt := serverAuthPluginData[:len(serverAuthPluginData)-1] @@ -532,7 +532,7 @@ func (n *mysqlCachingSha2AuthMethod) HandleAuthPluginData(c *Conn, user string, switch cacheState { case AuthRejected: - return nil, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return nil, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) case AuthAccepted: // We need to write a more data packet to indicate the // handshake completed properly. This will be followed @@ -547,7 +547,7 @@ func (n *mysqlCachingSha2AuthMethod) HandleAuthPluginData(c *Conn, user string, return result, nil case AuthNeedMoreData: if !c.TLSEnabled() && !c.IsUnixSocket() { - return nil, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return nil, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } data, pos := c.startEphemeralPacketWithHeader(2) @@ -563,7 +563,7 @@ func (n *mysqlCachingSha2AuthMethod) HandleAuthPluginData(c *Conn, user string, return n.storage.UserEntryWithPassword(c, user, password, remoteAddr) default: // Somehow someone returned an unknown state, let's error with access denied. - return nil, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return nil, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } } diff --git a/go/mysql/auth_server_static.go b/go/mysql/auth_server_static.go index 6e3a9693c69..d9e6decf5e5 100644 --- a/go/mysql/auth_server_static.go +++ b/go/mysql/auth_server_static.go @@ -162,7 +162,7 @@ func (a *AuthServerStatic) UserEntryWithPassword(conn *Conn, user string, passwo a.mu.Unlock() if !ok { - return &StaticUserData{}, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &StaticUserData{}, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } for _, entry := range entries { @@ -171,7 +171,7 @@ func (a *AuthServerStatic) UserEntryWithPassword(conn *Conn, user string, passwo return &StaticUserData{entry.UserData, entry.Groups}, nil } } - return &StaticUserData{}, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &StaticUserData{}, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } // UserEntryWithHash implements password lookup based on a @@ -182,14 +182,14 @@ func (a *AuthServerStatic) UserEntryWithHash(conn *Conn, salt []byte, user strin a.mu.Unlock() if !ok { - return &StaticUserData{}, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &StaticUserData{}, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } for _, entry := range entries { if entry.MysqlNativePassword != "" { hash, err := DecodeMysqlNativePasswordHex(entry.MysqlNativePassword) if err != nil { - return &StaticUserData{entry.UserData, entry.Groups}, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &StaticUserData{entry.UserData, entry.Groups}, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } isPass := VerifyHashedMysqlNativePassword(authResponse, salt, hash) @@ -204,7 +204,7 @@ func (a *AuthServerStatic) UserEntryWithHash(conn *Conn, salt []byte, user strin } } } - return &StaticUserData{}, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &StaticUserData{}, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } // UserEntryWithCacheHash implements password lookup based on a @@ -215,7 +215,7 @@ func (a *AuthServerStatic) UserEntryWithCacheHash(conn *Conn, salt []byte, user a.mu.Unlock() if !ok { - return &StaticUserData{}, AuthRejected, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &StaticUserData{}, AuthRejected, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } for _, entry := range entries { @@ -226,7 +226,7 @@ func (a *AuthServerStatic) UserEntryWithCacheHash(conn *Conn, salt []byte, user return &StaticUserData{entry.UserData, entry.Groups}, AuthAccepted, nil } } - return &StaticUserData{}, AuthRejected, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &StaticUserData{}, AuthRejected, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } // AuthMethods returns the AuthMethod instances this auth server can handle. diff --git a/go/mysql/client.go b/go/mysql/client.go index 16740bf38db..2a72806a6be 100644 --- a/go/mysql/client.go +++ b/go/mysql/client.go @@ -95,11 +95,11 @@ func Connect(ctx context.Context, params *ConnParams) (*Conn, error) { // should return a 2003. if netProto == "tcp" { status <- connectResult{ - err: sqlerror.NewSQLError(sqlerror.CRConnHostError, sqlerror.SSUnknownSQLState, "net.Dial(%v) failed: %v", addr, err), + err: sqlerror.NewSQLErrorf(sqlerror.CRConnHostError, sqlerror.SSUnknownSQLState, "net.Dial(%v) failed: %v", addr, err), } } else { status <- connectResult{ - err: sqlerror.NewSQLError(sqlerror.CRConnectionError, sqlerror.SSUnknownSQLState, "net.Dial(%v) to local server failed: %v", addr, err), + err: sqlerror.NewSQLErrorf(sqlerror.CRConnectionError, sqlerror.SSUnknownSQLState, "net.Dial(%v) to local server failed: %v", addr, err), } } return @@ -179,11 +179,11 @@ func (c *Conn) Ping() error { data[pos] = ComPing if err := c.writeEphemeralPacket(); err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) } data, err := c.readEphemeralPacket() if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } defer c.recycleReadPacket() switch data[0] { @@ -208,7 +208,7 @@ func (c *Conn) clientHandshake(params *ConnParams) error { // Wait for the server initial handshake packet, and parse it. data, err := c.readPacket() if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, "", "initial packet read failed: %v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, "", "initial packet read failed: %v", err) } capabilities, salt, err := c.parseInitialHandshakePacket(data) if err != nil { @@ -219,7 +219,7 @@ func (c *Conn) clientHandshake(params *ConnParams) error { // Sanity check. if capabilities&CapabilityClientProtocol41 == 0 { - return sqlerror.NewSQLError(sqlerror.CRVersionError, sqlerror.SSUnknownSQLState, "cannot connect to servers earlier than 4.1") + return sqlerror.NewSQLErrorf(sqlerror.CRVersionError, sqlerror.SSUnknownSQLState, "cannot connect to servers earlier than 4.1") } // Remember a subset of the capabilities, so we can use them @@ -234,7 +234,7 @@ func (c *Conn) clientHandshake(params *ConnParams) error { // If client asked for SSL, but server doesn't support it, // stop right here. if params.SslRequired() && capabilities&CapabilityClientSSL == 0 { - return sqlerror.NewSQLError(sqlerror.CRSSLConnectionError, sqlerror.SSUnknownSQLState, "server doesn't support SSL but client asked for it") + return sqlerror.NewSQLErrorf(sqlerror.CRSSLConnectionError, sqlerror.SSUnknownSQLState, "server doesn't support SSL but client asked for it") } // The ServerName to verify depends on what the hostname is. @@ -255,13 +255,13 @@ func (c *Conn) clientHandshake(params *ConnParams) error { tlsVersion, err := vttls.TLSVersionToNumber(params.TLSMinVersion) if err != nil { - return sqlerror.NewSQLError(sqlerror.CRSSLConnectionError, sqlerror.SSUnknownSQLState, "error parsing minimal TLS version: %v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRSSLConnectionError, sqlerror.SSUnknownSQLState, "error parsing minimal TLS version: %v", err) } // Build the TLS config. clientConfig, err := vttls.ClientConfig(params.EffectiveSslMode(), params.SslCert, params.SslKey, params.SslCa, params.SslCrl, serverName, tlsVersion) if err != nil { - return sqlerror.NewSQLError(sqlerror.CRSSLConnectionError, sqlerror.SSUnknownSQLState, "error loading client cert and ca: %v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRSSLConnectionError, sqlerror.SSUnknownSQLState, "error loading client cert and ca: %v", err) } // Send the SSLRequest packet. @@ -292,7 +292,7 @@ func (c *Conn) clientHandshake(params *ConnParams) error { } else if params.Flags&CapabilityClientSessionTrack == CapabilityClientSessionTrack { // If client asked for ClientSessionTrack, but server doesn't support it, // stop right here. - return sqlerror.NewSQLError(sqlerror.CRSSLConnectionError, sqlerror.SSUnknownSQLState, "server doesn't support ClientSessionTrack but client asked for it") + return sqlerror.NewSQLErrorf(sqlerror.CRSSLConnectionError, sqlerror.SSUnknownSQLState, "server doesn't support ClientSessionTrack but client asked for it") } // Build and send our handshake response 41. @@ -317,7 +317,7 @@ func (c *Conn) clientHandshake(params *ConnParams) error { // Wait for response, should be OK. response, err := c.readPacket() if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } switch response[0] { case OKPacket: @@ -327,7 +327,7 @@ func (c *Conn) clientHandshake(params *ConnParams) error { return ParseErrorPacket(response) default: // FIXME(alainjobart) handle extra auth cases and so on. - return sqlerror.NewSQLError(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "initial server response is asking for more information, not implemented yet: %v", response) + return sqlerror.NewSQLErrorf(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "initial server response is asking for more information, not implemented yet: %v", response) } } @@ -342,7 +342,7 @@ func (c *Conn) parseInitialHandshakePacket(data []byte) (uint32, []byte, error) // Protocol version. pver, pos, ok := readByte(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRVersionError, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no protocol version") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRVersionError, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no protocol version") } // Server is allowed to immediately send ERR packet @@ -351,41 +351,41 @@ func (c *Conn) parseInitialHandshakePacket(data []byte) (uint32, []byte, error) // Normally there would be a 1-byte sql_state_marker field and a 5-byte // sql_state field here, but docs say these will not be present in this case. errorMsg, _, _ := readEOFString(data, pos) - return 0, nil, sqlerror.NewSQLError(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "immediate error from server errorCode=%v errorMsg=%v", errorCode, errorMsg) + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "immediate error from server errorCode=%v errorMsg=%v", errorCode, errorMsg) } if pver != protocolVersion { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRVersionError, sqlerror.SSUnknownSQLState, "bad protocol version: %v", pver) + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRVersionError, sqlerror.SSUnknownSQLState, "bad protocol version: %v", pver) } // Read the server version. c.ServerVersion, pos, ok = readNullString(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no server version") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no server version") } // Read the connection id. c.ConnectionID, pos, ok = readUint32(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no connection id") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no connection id") } // Read the first part of the auth-plugin-data authPluginData, pos, ok := readBytes(data, pos, 8) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no auth-plugin-data-part-1") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no auth-plugin-data-part-1") } // One byte filler, 0. We don't really care about the value. _, pos, ok = readByte(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no filler") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no filler") } // Lower 2 bytes of the capability flags. capLower, pos, ok := readUint16(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no capability flags (lower 2 bytes)") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no capability flags (lower 2 bytes)") } var capabilities = uint32(capLower) @@ -397,20 +397,20 @@ func (c *Conn) parseInitialHandshakePacket(data []byte) (uint32, []byte, error) // Character set. characterSet, pos, ok := readByte(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no character set") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no character set") } c.CharacterSet = collations.ID(characterSet) // Status flags. Ignored. _, pos, ok = readUint16(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no status flags") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no status flags") } // Upper 2 bytes of the capability flags. capUpper, pos, ok := readUint16(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no capability flags (upper 2 bytes)") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no capability flags (upper 2 bytes)") } capabilities += uint32(capUpper) << 16 @@ -420,13 +420,13 @@ func (c *Conn) parseInitialHandshakePacket(data []byte) (uint32, []byte, error) if capabilities&CapabilityClientPluginAuth != 0 { authPluginDataLength, pos, ok = readByte(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no length of auth-plugin-data") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no length of auth-plugin-data") } } else { // One byte filler, 0. We don't really care about the value. _, pos, ok = readByte(data, pos) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no length of auth-plugin-data filler") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no length of auth-plugin-data filler") } } @@ -443,12 +443,12 @@ func (c *Conn) parseInitialHandshakePacket(data []byte) (uint32, []byte, error) var authPluginDataPart2 []byte authPluginDataPart2, pos, ok = readBytes(data, pos, l) if !ok { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no auth-plugin-data-part-2") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: packet has no auth-plugin-data-part-2") } // The last byte has to be 0, and is not part of the data. if authPluginDataPart2[l-1] != 0 { - return 0, nil, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: auth-plugin-data-part-2 is not 0 terminated") + return 0, nil, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "parseInitialHandshakePacket: auth-plugin-data-part-2 is not 0 terminated") } authPluginData = append(authPluginData, authPluginDataPart2[0:l-1]...) } @@ -505,7 +505,7 @@ func (c *Conn) writeSSLRequest(capabilities uint32, characterSet uint8, params * // And send it as is. if err := c.writeEphemeralPacket(); err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "cannot send SSLRequest: %v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "cannot send SSLRequest: %v", err) } return nil } @@ -602,11 +602,11 @@ func (c *Conn) writeHandshakeResponse41(capabilities uint32, scrambledPassword [ // Sanity-check the length. if pos != len(data) { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "writeHandshakeResponse41: only packed %v bytes, out of %v allocated", pos, len(data)) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "writeHandshakeResponse41: only packed %v bytes, out of %v allocated", pos, len(data)) } if err := c.writeEphemeralPacket(); err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "cannot send HandshakeResponse41: %v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "cannot send HandshakeResponse41: %v", err) } return nil } @@ -616,7 +616,7 @@ func (c *Conn) writeHandshakeResponse41(capabilities uint32, scrambledPassword [ func (c *Conn) handleAuthResponse(params *ConnParams) error { response, err := c.readPacket() if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } switch response[0] { @@ -636,7 +636,7 @@ func (c *Conn) handleAuthResponse(params *ConnParams) error { case ErrPacket: return ParseErrorPacket(response) default: - return sqlerror.NewSQLError(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "initial server response cannot be parsed: %v", response) + return sqlerror.NewSQLErrorf(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "initial server response cannot be parsed: %v", response) } return nil @@ -648,7 +648,7 @@ func (c *Conn) handleAuthSwitchPacket(params *ConnParams, response []byte) error var salt []byte c.authPluginName, salt, err = parseAuthSwitchRequest(response) if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "cannot parse auth switch request: %v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "cannot parse auth switch request: %v", err) } if salt != nil { c.salt = salt @@ -669,7 +669,7 @@ func (c *Conn) handleAuthSwitchPacket(params *ConnParams, response []byte) error return err } default: - return sqlerror.NewSQLError(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "server asked for unsupported auth method: %v", c.authPluginName) + return sqlerror.NewSQLErrorf(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "server asked for unsupported auth method: %v", c.authPluginName) } // The response could be an OKPacket, AuthMoreDataPacket or ErrPacket @@ -711,7 +711,7 @@ func (c *Conn) handleAuthMoreDataPacket(data byte, params *ConnParams) error { // Next packet should either be an OKPacket or ErrPacket return c.handleAuthResponse(params) default: - return sqlerror.NewSQLError(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "cannot parse AuthMoreDataPacket: %v", data) + return sqlerror.NewSQLErrorf(sqlerror.CRServerHandshakeErr, sqlerror.SSUnknownSQLState, "cannot parse AuthMoreDataPacket: %v", data) } } @@ -741,7 +741,7 @@ func (c *Conn) requestPublicKey() (rsaKey *rsa.PublicKey, err error) { response, err := c.readPacket() if err != nil { - return nil, sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return nil, sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } // Server should respond with a AuthMoreDataPacket containing the public key diff --git a/go/mysql/collations/charset/simplifiedchinese/gb18030.go b/go/mysql/collations/charset/simplifiedchinese/gb18030.go index 0e09dc8e3ab..8d6a98ba046 100644 --- a/go/mysql/collations/charset/simplifiedchinese/gb18030.go +++ b/go/mysql/collations/charset/simplifiedchinese/gb18030.go @@ -150,7 +150,7 @@ func (Charset_gb18030) DecodeRune(src []byte) (rune, int) { return utf8.RuneError, 1 } c2 := src[2] - if c2 < 0x81 || 0xff <= c2 { + if c2 < 0x81 { return utf8.RuneError, 1 } c3 := src[3] diff --git a/go/mysql/conn.go b/go/mysql/conn.go index 9164e658111..56c2abff06e 100644 --- a/go/mysql/conn.go +++ b/go/mysql/conn.go @@ -585,7 +585,7 @@ func (c *Conn) readPacket() ([]byte, error) { func (c *Conn) ReadPacket() ([]byte, error) { result, err := c.readPacket() if err != nil { - return nil, sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return nil, sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } return result, err } @@ -1593,7 +1593,7 @@ func ParseErrorPacket(data []byte) error { // Error code is 2 bytes. code, pos, ok := readUint16(data, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRUnknownError, sqlerror.SSUnknownSQLState, "invalid error packet code: %v", data) + return sqlerror.NewSQLErrorf(sqlerror.CRUnknownError, sqlerror.SSUnknownSQLState, "invalid error packet code: %v", data) } // '#' marker of the SQL state is 1 byte. Ignored. @@ -1602,13 +1602,13 @@ func ParseErrorPacket(data []byte) error { // SQL state is 5 bytes sqlState, pos, ok := readBytes(data, pos, 5) if !ok { - return sqlerror.NewSQLError(sqlerror.CRUnknownError, sqlerror.SSUnknownSQLState, "invalid error packet sqlState: %v", data) + return sqlerror.NewSQLErrorf(sqlerror.CRUnknownError, sqlerror.SSUnknownSQLState, "invalid error packet sqlState: %v", data) } // Human readable error message is the rest. msg := string(data[pos:]) - return sqlerror.NewSQLError(sqlerror.ErrorCode(code), string(sqlState), "%v", msg) + return sqlerror.NewSQLErrorf(sqlerror.ErrorCode(code), string(sqlState), "%v", msg) } // GetTLSClientCerts gets TLS certificates. diff --git a/go/mysql/conn_test.go b/go/mysql/conn_test.go index 64b97052ead..786f4e4a19b 100644 --- a/go/mysql/conn_test.go +++ b/go/mysql/conn_test.go @@ -22,6 +22,7 @@ import ( crypto_rand "crypto/rand" "encoding/binary" "encoding/hex" + "errors" "fmt" "math/rand/v2" "net" @@ -937,7 +938,7 @@ func TestConnectionErrorWhileWritingComQuery(t *testing.T) { // this handler will return an error on the first run, and fail the test if it's run more times errorString := make([]byte, 17000) - handler := &testRun{t: t, err: fmt.Errorf(string(errorString))} + handler := &testRun{t: t, err: errors.New(string(errorString))} res := sConn.handleNextCommand(handler) require.False(t, res, "we should beak the connection in case of error writing error packet") } diff --git a/go/mysql/fakesqldb/server.go b/go/mysql/fakesqldb/server.go index 33512f23514..e2a275940d5 100644 --- a/go/mysql/fakesqldb/server.go +++ b/go/mysql/fakesqldb/server.go @@ -432,7 +432,7 @@ func (db *DB) HandleQuery(c *mysql.Conn, query string, callback func(*sqltypes.R userCallback(query) } if pat.err != "" { - return fmt.Errorf(pat.err) + return errors.New(pat.err) } return callback(pat.result) } @@ -853,7 +853,7 @@ func (db *DB) GetQueryPatternResult(key string) (func(string), ExpectedResult, b userCallback, ok := db.queryPatternUserCallback[pat.expr] if ok { if pat.err != "" { - return userCallback, ExpectedResult{pat.result, nil}, true, fmt.Errorf(pat.err) + return userCallback, ExpectedResult{pat.result, nil}, true, errors.New(pat.err) } return userCallback, ExpectedResult{pat.result, nil}, true, nil } diff --git a/go/mysql/flavor_filepos.go b/go/mysql/flavor_filepos.go index 565aa2a807d..01d748c66f3 100644 --- a/go/mysql/flavor_filepos.go +++ b/go/mysql/flavor_filepos.go @@ -148,7 +148,7 @@ func (flv *filePosFlavor) readBinlogEvent(c *Conn) (BinlogEvent, error) { } switch result[0] { case EOFPacket: - return nil, sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", io.EOF) + return nil, sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", io.EOF) case ErrPacket: return nil, ParseErrorPacket(result) } diff --git a/go/mysql/flavor_mariadb.go b/go/mysql/flavor_mariadb.go index 301ec2b0596..bafb24a0c77 100644 --- a/go/mysql/flavor_mariadb.go +++ b/go/mysql/flavor_mariadb.go @@ -351,7 +351,7 @@ func (mariadbFlavor) readBinlogEvent(c *Conn) (BinlogEvent, error) { } switch result[0] { case EOFPacket: - return nil, sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", io.EOF) + return nil, sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", io.EOF) case ErrPacket: return nil, ParseErrorPacket(result) } diff --git a/go/mysql/flavor_mysql.go b/go/mysql/flavor_mysql.go index 5de3dc4ed46..5d92694e9f2 100644 --- a/go/mysql/flavor_mysql.go +++ b/go/mysql/flavor_mysql.go @@ -386,7 +386,7 @@ func (mysqlFlavor) readBinlogEvent(c *Conn) (BinlogEvent, error) { } switch result[0] { case EOFPacket: - return nil, sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", io.EOF) + return nil, sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", io.EOF) case ErrPacket: return nil, ParseErrorPacket(result) } diff --git a/go/mysql/query.go b/go/mysql/query.go index 10f36a09b1d..9126a85b2c5 100644 --- a/go/mysql/query.go +++ b/go/mysql/query.go @@ -99,36 +99,36 @@ func (c *Conn) writeComSetOption(operation uint16) error { func (c *Conn) readColumnDefinition(field *querypb.Field, index int) error { colDef, err := c.readEphemeralPacket() if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } defer c.recycleReadPacket() // Catalog is ignored, always set to "def" pos, ok := skipLenEncString(colDef, 0) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v catalog failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v catalog failed", index) } // schema, table, orgTable, name and OrgName are strings. field.Database, pos, ok = readLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v schema failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v schema failed", index) } field.Table, pos, ok = readLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v table failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v table failed", index) } field.OrgTable, pos, ok = readLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v org_table failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v org_table failed", index) } field.Name, pos, ok = readLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v name failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v name failed", index) } field.OrgName, pos, ok = readLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v org_name failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v org_name failed", index) } // Skip length of fixed-length fields. @@ -137,37 +137,37 @@ func (c *Conn) readColumnDefinition(field *querypb.Field, index int) error { // characterSet is a uint16. characterSet, pos, ok := readUint16(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v characterSet failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v characterSet failed", index) } field.Charset = uint32(characterSet) // columnLength is a uint32. field.ColumnLength, pos, ok = readUint32(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v columnLength failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v columnLength failed", index) } // type is one byte. t, pos, ok := readByte(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v type failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v type failed", index) } // flags is 2 bytes. flags, pos, ok := readUint16(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v flags failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v flags failed", index) } // Convert MySQL type to Vitess type. field.Type, err = sqltypes.MySQLToType(t, int64(flags)) if err != nil { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "MySQLToType(%v,%v) failed for column %v: %v", t, flags, index, err) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "MySQLToType(%v,%v) failed for column %v: %v", t, flags, index, err) } // Decimals is a byte. decimals, _, ok := readByte(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v decimals failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v decimals failed", index) } field.Decimals = uint32(decimals) @@ -197,7 +197,7 @@ func (c *Conn) readColumnDefinition(field *querypb.Field, index int) error { func (c *Conn) readColumnDefinitionType(field *querypb.Field, index int) error { colDef, err := c.readEphemeralPacket() if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } defer c.recycleReadPacket() @@ -205,27 +205,27 @@ func (c *Conn) readColumnDefinitionType(field *querypb.Field, index int) error { // strings, all skipped. pos, ok := skipLenEncString(colDef, 0) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v catalog failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v catalog failed", index) } pos, ok = skipLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v schema failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v schema failed", index) } pos, ok = skipLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v table failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v table failed", index) } pos, ok = skipLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v org_table failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v org_table failed", index) } pos, ok = skipLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v name failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v name failed", index) } pos, ok = skipLenEncString(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v org_name failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "skipping col %v org_name failed", index) } // Skip length of fixed-length fields. @@ -234,31 +234,31 @@ func (c *Conn) readColumnDefinitionType(field *querypb.Field, index int) error { // characterSet is a uint16. _, pos, ok = readUint16(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v characterSet failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v characterSet failed", index) } // columnLength is a uint32. _, pos, ok = readUint32(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v columnLength failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v columnLength failed", index) } // type is one byte t, pos, ok := readByte(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v type failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v type failed", index) } // flags is 2 bytes flags, _, ok := readUint16(colDef, pos) if !ok { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v flags failed", index) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "extracting col %v flags failed", index) } // Convert MySQL type to Vitess type. field.Type, err = sqltypes.MySQLToType(t, int64(flags)) if err != nil { - return sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "MySQLToType(%v,%v) failed for column %v: %v", t, flags, index, err) + return sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "MySQLToType(%v,%v) failed for column %v: %v", t, flags, index, err) } // skip decimals @@ -435,7 +435,7 @@ func (c *Conn) ReadQueryResult(maxrows int, wantfields bool) (*sqltypes.Result, // EOF is only present here if it's not deprecated. data, err := c.readEphemeralPacket() if err != nil { - return nil, false, 0, sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return nil, false, 0, sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } if c.isEOFPacket(data) { @@ -457,7 +457,7 @@ func (c *Conn) ReadQueryResult(maxrows int, wantfields bool) (*sqltypes.Result, for { data, err := c.readEphemeralPacket() if err != nil { - return nil, false, 0, sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return nil, false, 0, sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } if c.isEOFPacket(data) { @@ -527,7 +527,7 @@ func (c *Conn) drainResults() error { for { data, err := c.readEphemeralPacket() if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } if c.isEOFPacket(data) { c.recycleReadPacket() @@ -543,7 +543,7 @@ func (c *Conn) drainResults() error { func (c *Conn) readComQueryResponse(packetOk *PacketOK) (int, error) { data, err := c.readEphemeralPacket() if err != nil { - return 0, sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return 0, sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } defer c.recycleReadPacket() if len(data) == 0 { @@ -641,7 +641,7 @@ func (c *Conn) parseComStmtExecute(prepareData map[uint32]*PrepareData, data []b // convert MySQL type to internal type. valType, err := sqltypes.MySQLToType(mysqlType, int64(flags)) if err != nil { - return stmtID, 0, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "MySQLToType(%v,%v) failed: %v", mysqlType, flags, err) + return stmtID, 0, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "MySQLToType(%v,%v) failed: %v", mysqlType, flags, err) } prepare.ParamsType[i] = int32(valType) @@ -663,7 +663,7 @@ func (c *Conn) parseComStmtExecute(prepareData map[uint32]*PrepareData, data []b val, pos, ok = c.parseStmtArgs(payload, querypb.Type(prepare.ParamsType[i]), pos) } if !ok { - return stmtID, 0, sqlerror.NewSQLError(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "decoding parameter value failed: %v", prepare.ParamsType[i]) + return stmtID, 0, sqlerror.NewSQLErrorf(sqlerror.CRMalformedPacket, sqlerror.SSUnknownSQLState, "decoding parameter value failed: %v", prepare.ParamsType[i]) } prepare.BindVars[parameterID] = sqltypes.ValueBindVariable(val) @@ -696,7 +696,7 @@ func (c *Conn) parseStmtArgs(data []byte, typ querypb.Type, pos int) (sqltypes.V return sqltypes.NewInt64(int64(int32(val))), pos, ok case sqltypes.Float32: val, pos, ok := readUint32(data, pos) - return sqltypes.NewFloat64(float64(math.Float32frombits(uint32(val)))), pos, ok + return sqltypes.NewFloat64(float64(math.Float32frombits(val))), pos, ok case sqltypes.Uint64: val, pos, ok := readUint64(data, pos) return sqltypes.NewUint64(val), pos, ok @@ -1268,7 +1268,7 @@ func val2MySQL(v sqltypes.Value) ([]byte, error) { return []byte{}, err } out = make([]byte, 8) - writeUint64(out, pos, uint64(val)) + writeUint64(out, pos, val) case sqltypes.Int64: val, err := strconv.ParseInt(v.ToString(), 10, 64) if err != nil { @@ -1437,7 +1437,7 @@ func val2MySQL(v sqltypes.Value) ([]byte, error) { if err != nil { return []byte{}, err } - pos = writeUint32(out, pos, uint32(days)) + pos = writeUint32(out, pos, days) pos = writeByte(out, pos, byte(hours)) pos = writeByte(out, pos, byte(minutes)) pos = writeByte(out, pos, byte(seconds)) @@ -1493,7 +1493,7 @@ func val2MySQL(v sqltypes.Value) ([]byte, error) { if err != nil { return []byte{}, err } - pos = writeUint32(out, pos, uint32(days)) + pos = writeUint32(out, pos, days) pos = writeByte(out, pos, byte(hours)) pos = writeByte(out, pos, byte(minutes)) writeByte(out, pos, byte(seconds)) diff --git a/go/mysql/replication.go b/go/mysql/replication.go index 08baaa169c8..84c65842c7e 100644 --- a/go/mysql/replication.go +++ b/go/mysql/replication.go @@ -48,7 +48,7 @@ func (c *Conn) WriteComBinlogDump(serverID uint32, binlogFilename string, binlog pos = writeUint32(data, pos, serverID) _ = writeEOFString(data, pos, binlogFilename) if err := c.writeEphemeralPacket(); err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) } return nil } @@ -86,16 +86,16 @@ func (c *Conn) WriteComBinlogDumpGTID(serverID uint32, binlogFilename string, bi 4 + // data-size len(gtidSet) // data data, pos := c.startEphemeralPacketWithHeader(length) - pos = writeByte(data, pos, ComBinlogDumpGTID) //nolint - pos = writeUint16(data, pos, flags) //nolint - pos = writeUint32(data, pos, serverID) //nolint - pos = writeUint32(data, pos, uint32(len(binlogFilename))) //nolint - pos = writeEOFString(data, pos, binlogFilename) //nolint - pos = writeUint64(data, pos, binlogPos) //nolint - pos = writeUint32(data, pos, uint32(len(gtidSet))) //nolint - pos += copy(data[pos:], gtidSet) //nolint + pos = writeByte(data, pos, ComBinlogDumpGTID) // nolint + pos = writeUint16(data, pos, flags) // nolint + pos = writeUint32(data, pos, serverID) // nolint + pos = writeUint32(data, pos, uint32(len(binlogFilename))) // nolint + pos = writeEOFString(data, pos, binlogFilename) // nolint + pos = writeUint64(data, pos, binlogPos) // nolint + pos = writeUint32(data, pos, uint32(len(gtidSet))) // nolint + pos += copy(data[pos:], gtidSet) // nolint if err := c.writeEphemeralPacket(); err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) } return nil } @@ -113,7 +113,7 @@ func (c *Conn) SendSemiSyncAck(binlogFilename string, binlogPos uint64) error { pos = writeUint64(data, pos, binlogPos) _ = writeEOFString(data, pos, binlogFilename) if err := c.writeEphemeralPacket(); err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) } return nil @@ -135,7 +135,7 @@ func (c *Conn) WriteBinlogEvent(ev BinlogEvent, semiSyncEnabled bool) error { } _ = writeEOFString(data, pos, string(ev.Bytes())) if err := c.writeEphemeralPacket(); err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerGone, sqlerror.SSUnknownSQLState, "%v", err) } return nil } diff --git a/go/mysql/replication/mysql56_gtid.go b/go/mysql/replication/mysql56_gtid.go index dd23fb2092b..dd55caf1949 100644 --- a/go/mysql/replication/mysql56_gtid.go +++ b/go/mysql/replication/mysql56_gtid.go @@ -153,11 +153,11 @@ func DecodePositionMySQL56(s string) (rp Position, gtidSet Mysql56GTIDSet, err e return rp, nil, err } if !rp.MatchesFlavor(Mysql56FlavorID) { - return rp, nil, vterrors.Wrapf(ErrExpectMysql56Flavor, s) + return rp, nil, vterrors.Wrap(ErrExpectMysql56Flavor, s) } gtidSet, ok = rp.GTIDSet.(Mysql56GTIDSet) if !ok { - return rp, nil, vterrors.Wrapf(ErrExpectMysql56Flavor, s) + return rp, nil, vterrors.Wrap(ErrExpectMysql56Flavor, s) } return rp, gtidSet, nil } diff --git a/go/mysql/sqlerror/sql_error.go b/go/mysql/sqlerror/sql_error.go index 63883760243..f2a5fb46388 100644 --- a/go/mysql/sqlerror/sql_error.go +++ b/go/mysql/sqlerror/sql_error.go @@ -38,14 +38,18 @@ type SQLError struct { // NewSQLError creates a new SQLError. // If sqlState is left empty, it will default to "HY000" (general error). // TODO: Should be aligned with vterrors, stack traces and wrapping -func NewSQLError(number ErrorCode, sqlState string, format string, args ...any) *SQLError { +func NewSQLErrorf(number ErrorCode, sqlState string, format string, args ...any) *SQLError { + return NewSQLError(number, sqlState, fmt.Sprintf(format, args...)) +} + +func NewSQLError(number ErrorCode, sqlState string, msg string) *SQLError { if sqlState == "" { sqlState = SSUnknownSQLState } return &SQLError{ Num: number, State: sqlState, - Message: fmt.Sprintf(format, args...), + Message: msg, } } @@ -290,7 +294,7 @@ func convertToMysqlError(err error) error { if !ok { return err } - return NewSQLError(mysqlCode.num, mysqlCode.state, err.Error()) + return NewSQLError(mysqlCode.num, mysqlCode.state, err.Error()) //nolint:govet } var isGRPCOverflowRE = regexp.MustCompile(`.*?grpc: (received|trying to send) message larger than max \(\d+ vs. \d+\)`) diff --git a/go/mysql/streaming_query.go b/go/mysql/streaming_query.go index 3d0d9ef49e8..95b4e293601 100644 --- a/go/mysql/streaming_query.go +++ b/go/mysql/streaming_query.go @@ -78,7 +78,7 @@ func (c *Conn) ExecuteStreamFetch(query string) (err error) { // EOF is only present here if it's not deprecated. data, err := c.readEphemeralPacket() if err != nil { - return sqlerror.NewSQLError(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) + return sqlerror.NewSQLErrorf(sqlerror.CRServerLost, sqlerror.SSUnknownSQLState, "%v", err) } defer c.recycleReadPacket() if c.isEOFPacket(data) { @@ -88,7 +88,7 @@ func (c *Conn) ExecuteStreamFetch(query string) (err error) { } else if isErrorPacket(data) { return ParseErrorPacket(data) } else { - return sqlerror.NewSQLError(sqlerror.CRCommandsOutOfSync, sqlerror.SSUnknownSQLState, "unexpected packet after fields: %v", data) + return sqlerror.NewSQLErrorf(sqlerror.CRCommandsOutOfSync, sqlerror.SSUnknownSQLState, "unexpected packet after fields: %v", data) } } diff --git a/go/mysql/vault/auth_server_vault.go b/go/mysql/vault/auth_server_vault.go index d2bc2548817..1f86d84ac40 100644 --- a/go/mysql/vault/auth_server_vault.go +++ b/go/mysql/vault/auth_server_vault.go @@ -159,14 +159,14 @@ func (a *AuthServerVault) UserEntryWithHash(conn *mysql.Conn, salt []byte, user a.mu.Unlock() if !ok { - return &mysql.StaticUserData{}, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &mysql.StaticUserData{}, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } for _, entry := range userEntries { if entry.MysqlNativePassword != "" { hash, err := mysql.DecodeMysqlNativePasswordHex(entry.MysqlNativePassword) if err != nil { - return &mysql.StaticUserData{Username: entry.UserData, Groups: entry.Groups}, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &mysql.StaticUserData{Username: entry.UserData, Groups: entry.Groups}, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } isPass := mysql.VerifyHashedMysqlNativePassword(authResponse, salt, hash) if mysql.MatchSourceHost(remoteAddr, entry.SourceHost) && isPass { @@ -180,7 +180,7 @@ func (a *AuthServerVault) UserEntryWithHash(conn *mysql.Conn, salt []byte, user } } } - return &mysql.StaticUserData{}, sqlerror.NewSQLError(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) + return &mysql.StaticUserData{}, sqlerror.NewSQLErrorf(sqlerror.ERAccessDeniedError, sqlerror.SSAccessDeniedError, "Access denied for user '%v'", user) } func (a *AuthServerVault) setTTLTicker(ttl time.Duration) { diff --git a/go/test/endtoend/vreplication/cluster_test.go b/go/test/endtoend/vreplication/cluster_test.go index 218fc2b768a..012423ca750 100644 --- a/go/test/endtoend/vreplication/cluster_test.go +++ b/go/test/endtoend/vreplication/cluster_test.go @@ -472,7 +472,7 @@ func (vc *VitessCluster) AddKeyspace(t *testing.T, cells []*Cell, ksName string, } if err := vc.VtctldClient.CreateKeyspace(keyspace.Name, keyspace.SidecarDBName); err != nil { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } log.Infof("Applying throttler config for keyspace %s", keyspace.Name) @@ -498,13 +498,13 @@ func (vc *VitessCluster) AddKeyspace(t *testing.T, cells []*Cell, ksName string, require.NoError(t, vc.AddShards(t, cells, keyspace, shards, numReplicas, numRdonly, tabletIDBase, opts)) if schema != "" { if err := vc.VtctlClient.ApplySchema(ksName, schema); err != nil { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } } keyspace.Schema = schema if vschema != "" { if err := vc.VtctlClient.ApplyVSchema(ksName, vschema); err != nil { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } } keyspace.VSchema = vschema @@ -682,7 +682,7 @@ func (vc *VitessCluster) AddShards(t *testing.T, cells []*Cell, keyspace *Keyspa for ind, tablet := range tablets { log.Infof("Running Setup() for vttablet %s", tablets[ind].Name) if err := tablet.Vttablet.Setup(); err != nil { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } // Set time_zone to UTC for all tablets. Without this it fails locally on some MacOS setups. query := "SET GLOBAL time_zone = '+00:00';" @@ -782,7 +782,7 @@ func (vc *VitessCluster) StartVtgate(t testing.TB, cell *Cell, cellsToWatch stri vc.ClusterConfig.vtgatePlannerVersion) require.NotNil(t, vtgate) if err := vtgate.Setup(); err != nil { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } cell.Vtgates = append(cell.Vtgates, vtgate) } diff --git a/go/vt/discovery/tablet_picker.go b/go/vt/discovery/tablet_picker.go index fd1ff64a3ce..c48905be948 100644 --- a/go/vt/discovery/tablet_picker.go +++ b/go/vt/discovery/tablet_picker.go @@ -18,7 +18,6 @@ package discovery import ( "context" - "fmt" "io" "math/rand/v2" "sort" @@ -181,7 +180,7 @@ func NewTabletPicker( } if len(missingFields) > 0 { return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, - fmt.Sprintf("Missing required field(s) for tablet picker: %s", strings.Join(missingFields, ", "))) + "Missing required field(s) for tablet picker: %s", strings.Join(missingFields, ", ")) } // Resolve tablet picker options diff --git a/go/vt/mysqlctl/s3backupstorage/s3.go b/go/vt/mysqlctl/s3backupstorage/s3.go index cdc4e355d45..9686b4a3978 100644 --- a/go/vt/mysqlctl/s3backupstorage/s3.go +++ b/go/vt/mysqlctl/s3backupstorage/s3.go @@ -28,6 +28,7 @@ import ( "crypto/md5" "crypto/tls" "encoding/base64" + "errors" "fmt" "io" "math" @@ -412,7 +413,7 @@ func (bs *S3BackupStorage) RemoveBackup(ctx context.Context, dir, name string) e } for _, objError := range out.Errors { - return fmt.Errorf(objError.String()) + return errors.New(objError.String()) } if objs.NextContinuationToken == nil { diff --git a/go/vt/sidecardb/sidecardb_test.go b/go/vt/sidecardb/sidecardb_test.go index 55c2c6cd6b5..70b89f17056 100644 --- a/go/vt/sidecardb/sidecardb_test.go +++ b/go/vt/sidecardb/sidecardb_test.go @@ -18,6 +18,7 @@ package sidecardb import ( "context" + "errors" "expvar" "fmt" "sort" @@ -80,7 +81,7 @@ func TestInitErrors(t *testing.T) { if ok { for _, e := range schemaErrors { if strings.EqualFold(e.tableName, createTable.Table.Name.String()) { - return nil, fmt.Errorf(e.errorValue) + return nil, errors.New(e.errorValue) } } } diff --git a/go/vt/sqlparser/goyacc/goyacc.go b/go/vt/sqlparser/goyacc/goyacc.go index 51650b0891e..14ab8c2eed7 100644 --- a/go/vt/sqlparser/goyacc/goyacc.go +++ b/go/vt/sqlparser/goyacc/goyacc.go @@ -85,7 +85,7 @@ const ( ERRCODE = 8190 ACCEPTCODE = 8191 YYLEXUNK = 3 - TOKSTART = 4 //index of first defined token + TOKSTART = 4 // index of first defined token ) // no, left, right, binary assoc. @@ -617,7 +617,7 @@ outer: } j = chfind(2, tokname) if j >= NTBASE { - lerrorf(ruleline, "nonterminal "+nontrst[j-NTBASE].name+" illegal after %%prec") + lerrorf(ruleline, "nonterminal %s illegal after %%prec", nontrst[j-NTBASE].name) } levprd[nprod] = toklev[j] t = gettok() @@ -1730,7 +1730,7 @@ more: } if pempty[i] != OK { fatfl = 0 - errorf("nonterminal " + nontrst[i].name + " never derives any token string") + errorf("nonterminal %s never derives any token string", nontrst[i].name) } } @@ -2937,7 +2937,7 @@ func others() { aryfil(temp1, nprod, 0) // - //yyr2 is the number of rules for each production + // yyr2 is the number of rules for each production // for i = 1; i < nprod; i++ { temp1[i] = len(prdptr[i]) - 2 @@ -3276,7 +3276,7 @@ func getrune(f *bufio.Reader) rune { if err != nil { errorf("read error: %v", err) } - //fmt.Printf("rune = %v n=%v\n", string(c), n); + // fmt.Printf("rune = %v n=%v\n", string(c), n); return c } @@ -3295,7 +3295,7 @@ func open(s string) *bufio.Reader { if err != nil { errorf("error opening %v: %v", s, err) } - //fmt.Printf("open %v\n", s); + // fmt.Printf("open %v\n", s); return bufio.NewReader(fi) } @@ -3304,7 +3304,7 @@ func create(s string) *bufio.Writer { if err != nil { errorf("error creating %v: %v", s, err) } - //fmt.Printf("create %v mode %v\n", s); + // fmt.Printf("create %v mode %v\n", s); return bufio.NewWriter(fo) } diff --git a/go/vt/topo/shard.go b/go/vt/topo/shard.go index 77983f20d2d..ba3a02a68ca 100644 --- a/go/vt/topo/shard.go +++ b/go/vt/topo/shard.go @@ -19,6 +19,7 @@ package topo import ( "context" "encoding/hex" + "errors" "fmt" "path" "slices" @@ -393,7 +394,7 @@ func (si *ShardInfo) UpdateDeniedTables(ctx context.Context, tabletType topodata return err } if tabletType == topodatapb.TabletType_PRIMARY && len(cells) > 0 { - return fmt.Errorf(dlNoCellsForPrimary) + return errors.New(dlNoCellsForPrimary) } tc := si.GetTabletControl(tabletType) if tc == nil { diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index 03b9e3d7077..1f07dce40ff 100644 --- a/go/vt/vtctl/vtctl.go +++ b/go/vt/vtctl/vtctl.go @@ -2242,24 +2242,24 @@ func commandVReplicationWorkflow(ctx context.Context, wr *wrangler.Wrangler, sub } if *atomicCopy { - var errors []string + var errs []string if !*allTables { - errors = append(errors, "atomic copy requires --all.") + errs = append(errs, "atomic copy requires --all.") } if *tables != "" { - errors = append(errors, "atomic copy does not support specifying tables.") + errs = append(errs, "atomic copy does not support specifying tables.") } if *excludes != "" { - errors = append(errors, "atomic copy does not support specifying excludes.") + errs = append(errs, "atomic copy does not support specifying excludes.") } - if len(errors) > 0 { - errors = append(errors, "Found options incompatible with atomic copy:") - return fmt.Errorf(strings.Join(errors, " ")) + if len(errs) > 0 { + errs = append(errs, "Found options incompatible with atomic copy:") + return errors.New(strings.Join(errs, " ")) } } if !*allTables && *tables == "" { - return fmt.Errorf("no tables specified to move") + return errors.New("no tables specified to move") } vrwp.SourceKeyspace = *sourceKeyspace vrwp.Tables = *tables @@ -3740,7 +3740,7 @@ func commandWorkflow(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag return err } if subFlags.NArg() < 2 { - return fmt.Errorf(usage) + return errors.New(usage) } if len(*shards) > 0 { log.Infof("Subset of shards specified: %d, %v", len(*shards), strings.Join(*shards, ",")) @@ -3775,7 +3775,7 @@ func commandWorkflow(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag } } else { if subFlags.NArg() != 2 { - return fmt.Errorf(usage) + return errors.New(usage) } var rpcReq any = nil if action == "update" { @@ -3817,7 +3817,7 @@ func commandWorkflow(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag onddl = ival } if !changes { - return fmt.Errorf(errWorkflowUpdateWithoutChanges) + return errors.New(errWorkflowUpdateWithoutChanges) } tsp := tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN if inorder { diff --git a/go/vt/vterrors/errors_test.go b/go/vt/vterrors/errors_test.go index 49b77ee0385..3444b0986c4 100644 --- a/go/vt/vterrors/errors_test.go +++ b/go/vt/vterrors/errors_test.go @@ -213,7 +213,7 @@ func TestWrapf(t *testing.T) { } for _, tt := range tests { - got := Wrapf(tt.err, tt.message).Error() + got := Wrap(tt.err, tt.message).Error() if got != tt.want { t.Errorf("Wrapf(%v, %q): got: %v, want %v", tt.err, tt.message, got, tt.want) } diff --git a/go/vt/vterrors/vterrors.go b/go/vt/vterrors/vterrors.go index 6a322837de9..c97a7c8e45f 100644 --- a/go/vt/vterrors/vterrors.go +++ b/go/vt/vterrors/vterrors.go @@ -150,10 +150,14 @@ func Errorf(code vtrpcpb.Code, format string, args ...any) error { // NewErrorf also records the stack trace at the point it was called. // Use this for errors in Vitess that we eventually want to mimic as a MySQL error func NewErrorf(code vtrpcpb.Code, state State, format string, args ...any) error { - msg := format - if len(args) != 0 { - msg = fmt.Sprintf(format, args...) - } + return NewError(code, state, fmt.Sprintf(format, args...)) +} + +// NewErrorf formats according to a format specifier and returns the string +// as a value that satisfies error. +// NewErrorf also records the stack trace at the point it was called. +// Use this for errors in Vitess that we eventually want to mimic as a MySQL error +func NewError(code vtrpcpb.Code, state State, msg string) error { return &fundamental{ msg: msg, code: code, @@ -251,14 +255,7 @@ func Wrap(err error, message string) error { // at the point Wrapf is call, and the format specifier. // If err is nil, Wrapf returns nil. func Wrapf(err error, format string, args ...any) error { - if err == nil { - return nil - } - return &wrapping{ - cause: err, - msg: fmt.Sprintf(format, args...), - stack: callers(), - } + return Wrap(err, fmt.Sprintf(format, args...)) } // Unwrap attempts to return the Cause of the given error, if it is indeed the result of a vterrors.Wrapf() diff --git a/go/vt/vtexplain/vtexplain_test.go b/go/vt/vtexplain/vtexplain_test.go index ed32d0698db..e9420b043c7 100644 --- a/go/vt/vtexplain/vtexplain_test.go +++ b/go/vt/vtexplain/vtexplain_test.go @@ -296,7 +296,7 @@ func TestJSONOutput(t *testing.T) { }` diff := cmp.Diff(wantJSON, string(actionsJSON)) if diff != "" { - t.Errorf(diff) + t.Error(diff) } } diff --git a/go/vt/vtgate/evalengine/fn_regexp.go b/go/vt/vtgate/evalengine/fn_regexp.go index a94b9a83aee..10aa3f6b6c6 100644 --- a/go/vt/vtgate/evalengine/fn_regexp.go +++ b/go/vt/vtgate/evalengine/fn_regexp.go @@ -167,43 +167,43 @@ func compileRegex(pat eval, c colldata.Charset, flags icuregex.RegexpFlag) (*icu var compileErr *icuregex.CompileError if errors.Is(err, icuerrors.ErrUnsupported) { - err = vterrors.NewErrorf(vtrpcpb.Code_UNIMPLEMENTED, vterrors.RegexpUnimplemented, err.Error()) + err = vterrors.NewError(vtrpcpb.Code_UNIMPLEMENTED, vterrors.RegexpUnimplemented, err.Error()) } else if errors.Is(err, icuerrors.ErrIllegalArgument) { - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpIllegalArgument, err.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpIllegalArgument, err.Error()) } else if errors.As(err, &compileErr) { switch compileErr.Code { case icuregex.InternalError: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInternal, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInternal, compileErr.Error()) case icuregex.RuleSyntax: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpRuleSyntax, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpRuleSyntax, compileErr.Error()) case icuregex.BadEscapeSequence: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpBadEscapeSequence, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpBadEscapeSequence, compileErr.Error()) case icuregex.PropertySyntax: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpRuleSyntax, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpRuleSyntax, compileErr.Error()) case icuregex.Unimplemented: - err = vterrors.NewErrorf(vtrpcpb.Code_UNIMPLEMENTED, vterrors.RegexpUnimplemented, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_UNIMPLEMENTED, vterrors.RegexpUnimplemented, compileErr.Error()) case icuregex.MismatchedParen: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpMismatchParen, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpMismatchParen, compileErr.Error()) case icuregex.BadInterval: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpBadInterval, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpBadInterval, compileErr.Error()) case icuregex.MaxLtMin: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpMaxLtMin, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpMaxLtMin, compileErr.Error()) case icuregex.InvalidBackRef: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInvalidBackRef, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInvalidBackRef, compileErr.Error()) case icuregex.InvalidFlag: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInvalidFlag, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInvalidFlag, compileErr.Error()) case icuregex.LookBehindLimit: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpLookBehindLimit, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpLookBehindLimit, compileErr.Error()) case icuregex.MissingCloseBracket: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpMissingCloseBracket, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpMissingCloseBracket, compileErr.Error()) case icuregex.InvalidRange: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInvalidRange, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInvalidRange, compileErr.Error()) case icuregex.PatternTooBig: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpPatternTooBig, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpPatternTooBig, compileErr.Error()) case icuregex.InvalidCaptureGroupName: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInvalidCaptureGroup, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInvalidCaptureGroup, compileErr.Error()) default: - err = vterrors.NewErrorf(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInternal, compileErr.Error()) + err = vterrors.NewError(vtrpcpb.Code_INVALID_ARGUMENT, vterrors.RegexpInternal, compileErr.Error()) } } diff --git a/go/vt/vtgate/evalengine/integration/fuzz_test.go b/go/vt/vtgate/evalengine/integration/fuzz_test.go index 17a721edde9..7372d6fd731 100644 --- a/go/vt/vtgate/evalengine/integration/fuzz_test.go +++ b/go/vt/vtgate/evalengine/integration/fuzz_test.go @@ -20,6 +20,7 @@ package integration import ( "encoding/json" + "errors" "fmt" "math/rand/v2" "os" @@ -205,11 +206,11 @@ func TestGenerateFuzzCases(t *testing.T) { remote, remoteErr := conn.ExecuteFetch(query, 1, false) if localErr != nil && strings.Contains(localErr.Error(), "syntax error at position") { - localErr = fmt.Errorf(localSyntaxErr) + localErr = errors.New(localSyntaxErr) } if remoteErr != nil && strings.Contains(remoteErr.Error(), "You have an error in your SQL syntax") { - remoteErr = fmt.Errorf(syntaxErr) + remoteErr = errors.New(syntaxErr) } res := mismatch{ diff --git a/go/vt/vtgate/evalengine/translate.go b/go/vt/vtgate/evalengine/translate.go index 0091f06a633..99e1508cc04 100644 --- a/go/vt/vtgate/evalengine/translate.go +++ b/go/vt/vtgate/evalengine/translate.go @@ -87,7 +87,7 @@ func (ast *astCompiler) translateComparisonExpr2(op sqlparser.ComparisonExprOper Negate: op == sqlparser.NotRegexpOp, }, nil default: - return nil, vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, op.ToString()) + return nil, vterrors.New(vtrpcpb.Code_UNIMPLEMENTED, op.ToString()) } } diff --git a/go/vt/vtgate/planbuilder/plan_test.go b/go/vt/vtgate/planbuilder/plan_test.go index f49994d37b2..b5dbed0ceb9 100644 --- a/go/vt/vtgate/planbuilder/plan_test.go +++ b/go/vt/vtgate/planbuilder/plan_test.go @@ -683,7 +683,7 @@ func (s *planTestSuite) testFile(filename string, vschema *vschemawrapper.VSchem if tcase.Skip { t.Skip(message) } else { - t.Errorf(message) + t.Error(message) } } else if tcase.Skip { t.Errorf("query is correct even though it is skipped:\n %s", tcase.Query) diff --git a/go/vt/vtgate/plugin_mysql_server.go b/go/vt/vtgate/plugin_mysql_server.go index 4004ae24566..dec7794c9bd 100644 --- a/go/vt/vtgate/plugin_mysql_server.go +++ b/go/vt/vtgate/plugin_mysql_server.go @@ -399,7 +399,7 @@ func (vh *vtgateHandler) KillConnection(ctx context.Context, connectionID uint32 c, exists := vh.connections[connectionID] if !exists { - return sqlerror.NewSQLError(sqlerror.ERNoSuchThread, sqlerror.SSUnknownSQLState, "Unknown thread id: %d", connectionID) + return sqlerror.NewSQLErrorf(sqlerror.ERNoSuchThread, sqlerror.SSUnknownSQLState, "Unknown thread id: %d", connectionID) } // First, we mark the connection for close, so that even when the context is cancelled, while returning the response back to client, @@ -417,7 +417,7 @@ func (vh *vtgateHandler) KillQuery(connectionID uint32) error { defer vh.mu.Unlock() c, exists := vh.connections[connectionID] if !exists { - return sqlerror.NewSQLError(sqlerror.ERNoSuchThread, sqlerror.SSUnknownSQLState, "Unknown thread id: %d", connectionID) + return sqlerror.NewSQLErrorf(sqlerror.ERNoSuchThread, sqlerror.SSUnknownSQLState, "Unknown thread id: %d", connectionID) } c.CancelCtx() return nil diff --git a/go/vt/vtgate/vindexes/region_experimental.go b/go/vt/vtgate/vindexes/region_experimental.go index c116e9bd84d..c6b867647aa 100644 --- a/go/vt/vtgate/vindexes/region_experimental.go +++ b/go/vt/vtgate/vindexes/region_experimental.go @@ -20,7 +20,6 @@ import ( "bytes" "context" "encoding/binary" - "fmt" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/key" @@ -61,7 +60,7 @@ type RegionExperimental struct { func newRegionExperimental(name string, m map[string]string) (Vindex, error) { rbs, ok := m[regionExperimentalParamRegionBytes] if !ok { - return nil, vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, fmt.Sprintf("region_experimental missing %s param", regionExperimentalParamRegionBytes)) + return nil, vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "region_experimental missing %s param", regionExperimentalParamRegionBytes) } var rb int switch rbs { diff --git a/go/vt/vtgate/vindexes/vschema.go b/go/vt/vtgate/vindexes/vschema.go index eba3ac49969..19b3a9039d4 100644 --- a/go/vt/vtgate/vindexes/vschema.go +++ b/go/vt/vtgate/vindexes/vschema.go @@ -963,7 +963,7 @@ outer: toTable, err = escapeQualifiedTable(toTable) if err != nil { vschema.RoutingRules[rule.FromTable] = &RoutingRule{ - Error: vterrors.Errorf( + Error: vterrors.New( vtrpcpb.Code_INVALID_ARGUMENT, err.Error(), ), @@ -1392,7 +1392,7 @@ func ChooseVindexForType(typ querypb.Type) (string, error) { // FindBestColVindex finds the best ColumnVindex for VReplication. func FindBestColVindex(table *Table) (*ColumnVindex, error) { - if table.ColumnVindexes == nil || len(table.ColumnVindexes) == 0 { + if len(table.ColumnVindexes) == 0 { return nil, vterrors.Errorf( vtrpcpb.Code_INVALID_ARGUMENT, "table %s has no vindex", diff --git a/go/vt/vtgate/vstream_manager_test.go b/go/vt/vtgate/vstream_manager_test.go index e51bd2785dd..4e10e60c758 100644 --- a/go/vt/vtgate/vstream_manager_test.go +++ b/go/vt/vtgate/vstream_manager_test.go @@ -458,7 +458,7 @@ func TestVStreamRetriableErrors(t *testing.T) { // Always have the local cell tablet error so it's ignored on retry and we pick the other one // if the error requires ignoring the tablet on retry. - sbc0.AddVStreamEvents(nil, vterrors.Errorf(tcase.code, tcase.msg)) + sbc0.AddVStreamEvents(nil, vterrors.New(tcase.code, tcase.msg)) if tcase.ignoreTablet { sbc1.AddVStreamEvents(commit, nil) diff --git a/go/vt/vtorc/inst/instance_dao.go b/go/vt/vtorc/inst/instance_dao.go index 0615cbc0cde..4e401606a95 100644 --- a/go/vt/vtorc/inst/instance_dao.go +++ b/go/vt/vtorc/inst/instance_dao.go @@ -141,8 +141,8 @@ func logReadTopologyInstanceError(tabletAlias string, hint string, err error) er strings.Replace(hint, "%", "%%", -1), // escape % err) } - log.Errorf(msg) - return fmt.Errorf(msg) + log.Error(msg) + return errors.New(msg) } // RegisterStats registers stats from the inst package @@ -933,7 +933,7 @@ func mkInsertOdkuForInstances(instances []*Instance, instanceWasActuallyFound bo if err != nil { errMsg := fmt.Sprintf("Failed to build query: %v", err) log.Errorf(errMsg) - return sql, args, fmt.Errorf(errMsg) + return sql, args, errors.New(errMsg) } return sql, args, nil @@ -1031,7 +1031,7 @@ func ForgetInstance(tabletAlias string) error { if tabletAlias == "" { errMsg := "ForgetInstance(): empty tabletAlias" log.Errorf(errMsg) - return fmt.Errorf(errMsg) + return errors.New(errMsg) } forgetAliases.Set(tabletAlias, true, cache.DefaultExpiration) log.Infof("Forgetting: %v", tabletAlias) @@ -1069,8 +1069,8 @@ func ForgetInstance(tabletAlias string) error { } if rows == 0 { errMsg := fmt.Sprintf("ForgetInstance(): tablet %+v not found", tabletAlias) - log.Errorf(errMsg) - return fmt.Errorf(errMsg) + log.Error(errMsg) + return errors.New(errMsg) } _ = AuditOperation("forget", tabletAlias, "") return nil diff --git a/go/vt/vtorc/logic/disable_recovery.go b/go/vt/vtorc/logic/disable_recovery.go index 4a3766055d2..74aa291e17a 100644 --- a/go/vt/vtorc/logic/disable_recovery.go +++ b/go/vt/vtorc/logic/disable_recovery.go @@ -30,6 +30,7 @@ package logic // go to the database each time. import ( + "errors" "fmt" "vitess.io/vitess/go/vt/external/golib/sqlutils" @@ -55,7 +56,7 @@ func IsRecoveryDisabled() (disabled bool, err error) { if err != nil { errMsg := fmt.Sprintf("recovery.IsRecoveryDisabled(): %v", err) log.Errorf(errMsg) - err = fmt.Errorf(errMsg) + err = errors.New(errMsg) } return disabled, err } diff --git a/go/vt/vtorc/logic/topology_recovery_dao.go b/go/vt/vtorc/logic/topology_recovery_dao.go index e8af34bdad4..1920da4dcd8 100644 --- a/go/vt/vtorc/logic/topology_recovery_dao.go +++ b/go/vt/vtorc/logic/topology_recovery_dao.go @@ -17,6 +17,7 @@ package logic import ( + "errors" "fmt" "strings" @@ -121,7 +122,7 @@ func AttemptRecoveryRegistration(analysisEntry *inst.ReplicationAnalysis) (*Topo if len(recoveries) > 0 { errMsg := fmt.Sprintf("AttemptRecoveryRegistration: Active recovery (id:%v) in the cluster %s:%s for %s", recoveries[0].ID, analysisEntry.ClusterDetails.Keyspace, analysisEntry.ClusterDetails.Shard, recoveries[0].AnalysisEntry.Analysis) log.Errorf(errMsg) - return nil, fmt.Errorf(errMsg) + return nil, errors.New(errMsg) } topologyRecovery := NewTopologyRecovery(*analysisEntry) diff --git a/go/vt/vttablet/endtoend/transaction_test.go b/go/vt/vttablet/endtoend/transaction_test.go index ad6ff558c40..2bc7a1b39d4 100644 --- a/go/vt/vttablet/endtoend/transaction_test.go +++ b/go/vt/vttablet/endtoend/transaction_test.go @@ -256,7 +256,7 @@ func TestPrepareRollback(t *testing.T) { err = client.Prepare("aa") if err != nil { client.RollbackPrepared("aa", 0) - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } err = client.RollbackPrepared("aa", 0) require.NoError(t, err) diff --git a/go/vt/vttablet/tabletmanager/tm_state.go b/go/vt/vttablet/tabletmanager/tm_state.go index 312c675fce7..d9389bf3559 100644 --- a/go/vt/vttablet/tabletmanager/tm_state.go +++ b/go/vt/vttablet/tabletmanager/tm_state.go @@ -281,7 +281,7 @@ func (ts *tmState) updateLocked(ctx context.Context) error { errStr := fmt.Sprintf("SetServingType(serving=false) failed: %v", err) log.Errorf(errStr) // No need to short circuit. Apply all steps and return error in the end. - returnErr = vterrors.Wrapf(err, errStr) + returnErr = vterrors.Wrap(err, errStr) } } @@ -289,7 +289,7 @@ func (ts *tmState) updateLocked(ctx context.Context) error { errStr := fmt.Sprintf("Cannot update denied tables rule: %v", err) log.Errorf(errStr) // No need to short circuit. Apply all steps and return error in the end. - returnErr = vterrors.Wrapf(err, errStr) + returnErr = vterrors.Wrap(err, errStr) } if ts.tm.UpdateStream != nil { @@ -329,7 +329,7 @@ func (ts *tmState) updateLocked(ctx context.Context) error { if err := ts.tm.QueryServiceControl.SetServingType(ts.tablet.Type, ptsTime, true, ""); err != nil { errStr := fmt.Sprintf("Cannot start query service: %v", err) log.Errorf(errStr) - returnErr = vterrors.Wrapf(err, errStr) + returnErr = vterrors.Wrap(err, errStr) } } diff --git a/go/vt/vttablet/tabletmanager/vdiff/action.go b/go/vt/vttablet/tabletmanager/vdiff/action.go index 0b9dd6f45ed..f81fe3205eb 100644 --- a/go/vt/vttablet/tabletmanager/vdiff/action.go +++ b/go/vt/vttablet/tabletmanager/vdiff/action.go @@ -37,7 +37,7 @@ import ( vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) -type VDiffAction string //nolint +type VDiffAction string // nolint const ( CreateAction VDiffAction = "create" @@ -238,9 +238,8 @@ func (vde *Engine) handleCreateResumeAction(ctx context.Context, dbClient binlog return err } if qr.RowsAffected == 0 { - msg := fmt.Sprintf("no completed or stopped vdiff found for UUID %s on tablet %v", + return fmt.Errorf("no completed or stopped vdiff found for UUID %s on tablet %v", req.VdiffUuid, vde.thisTablet.Alias) - return fmt.Errorf(msg) } } diff --git a/go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go b/go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go index 98cbb378fdd..91777f51b9c 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go +++ b/go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go @@ -297,7 +297,7 @@ func (tp *TablePlan) isOutsidePKRange(bindvars map[string]*querypb.BindVariable, case !before && after: bindvar = bindvars["a_"+tp.PKReferences[0]] } - if bindvar == nil { //should never happen + if bindvar == nil { // should never happen return false } @@ -332,7 +332,7 @@ func (tp *TablePlan) convertStringCharset(raw []byte, conversion *binlogdatapb.C out, err := charset.Convert(nil, colldata.Lookup(toCollation).Charset(), raw, colldata.Lookup(fromCollation).Charset()) if err != nil { - return nil, sqlerror.NewSQLError(sqlerror.ERTruncatedWrongValueForField, sqlerror.SSUnknownSQLState, "Incorrect string value: %s", err.Error()) + return nil, sqlerror.NewSQLErrorf(sqlerror.ERTruncatedWrongValueForField, sqlerror.SSUnknownSQLState, "Incorrect string value: %s", err.Error()) } return out, nil } diff --git a/go/vt/vttablet/tabletmanager/vreplication/vplayer.go b/go/vt/vttablet/tabletmanager/vreplication/vplayer.go index b1a84dd90b1..653cc713c8f 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vplayer.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vplayer.go @@ -414,7 +414,7 @@ func (vp *vplayer) recordHeartbeat() error { return nil } if err := vp.vr.updateHeartbeatTime(tm); err != nil { - return vterrors.Wrapf(errVPlayerStalled, fmt.Sprintf("%s: %v", failedToRecordHeartbeatMsg, err)) + return vterrors.Wrapf(errVPlayerStalled, "%s: %v", failedToRecordHeartbeatMsg, err) } // Only reset the pending heartbeat count if the update was successful. // Otherwise the vplayer may not actually be making progress and nobody diff --git a/go/vt/vttablet/tabletmanager/vreplication/vrlog_test.go b/go/vt/vttablet/tabletmanager/vreplication/vrlog_test.go index 3bd0dcf3217..48fe7fa983e 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vrlog_test.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vrlog_test.go @@ -23,6 +23,8 @@ import ( "strings" "testing" "time" + + "github.com/stretchr/testify/require" ) func TestVrLog(t *testing.T) { @@ -49,9 +51,7 @@ func TestVrLog(t *testing.T) { } want := fmt.Sprintf("%s Event %s", eventType, detail) - if !strings.Contains(s, want) { - t.Fatalf(fmt.Sprintf("want %s, got %s", want, s)) - } + require.Contains(t, s, want) if strings.HasSuffix(s, "\\n") { t.Fatalf("does not end in a newline: %s", s) } @@ -65,9 +65,7 @@ func TestVrLog(t *testing.T) { if err != nil { t.Fatalf("Duration is not an integer: %s", err) } - if lastColValue == 0 { - t.Fatalf("Duration should not be zero") - } + require.NotZero(t, lastColValue, "duration") stats = &VrLogStats{} stats.Send("detail123") diff --git a/go/vt/vttablet/tabletserver/schema/engine_test.go b/go/vt/vttablet/tabletserver/schema/engine_test.go index d4271dee876..e194fa8daa6 100644 --- a/go/vt/vttablet/tabletserver/schema/engine_test.go +++ b/go/vt/vttablet/tabletserver/schema/engine_test.go @@ -467,7 +467,7 @@ func TestOpenFailedDueToExecErr(t *testing.T) { defer db.Close() schematest.AddDefaultQueries(db) want := "injected error" - db.AddRejectedQuery(mysql.BaseShowTables, fmt.Errorf(want)) + db.AddRejectedQuery(mysql.BaseShowTables, errors.New(want)) se := newEngine(1*time.Second, 1*time.Second, 0, db) err := se.Open() if err == nil || !strings.Contains(err.Error(), want) { diff --git a/go/vt/vttablet/tabletserver/stateful_connection.go b/go/vt/vttablet/tabletserver/stateful_connection.go index 9b34cfce737..c0dc973fa87 100644 --- a/go/vt/vttablet/tabletserver/stateful_connection.go +++ b/go/vt/vttablet/tabletserver/stateful_connection.go @@ -150,7 +150,7 @@ func (sc *StatefulConnection) unlock(updateTime bool) { return } if sc.dbConn.Conn.IsClosed() { - sc.Releasef("unlocked closed connection") + sc.ReleaseString("unlocked closed connection") } else { sc.pool.markAsNotInUse(sc, updateTime) } @@ -159,16 +159,22 @@ func (sc *StatefulConnection) unlock(updateTime bool) { // Release is used when the connection will not be used ever again. // The underlying dbConn is removed so that this connection cannot be used by mistake. func (sc *StatefulConnection) Release(reason tx.ReleaseReason) { - sc.Releasef(reason.String()) + sc.ReleaseString(reason.String()) } // Releasef is used when the connection will not be used ever again. // The underlying dbConn is removed so that this connection cannot be used by mistake. func (sc *StatefulConnection) Releasef(reasonFormat string, a ...any) { + sc.ReleaseString(fmt.Sprintf(reasonFormat, a...)) +} + +// ReleaseString is used when the connection will not be used ever again. +// The underlying dbConn is removed so that this connection cannot be used by mistake. +func (sc *StatefulConnection) ReleaseString(reason string) { if sc.dbConn == nil { return } - sc.pool.unregister(sc.ConnID, fmt.Sprintf(reasonFormat, a...)) + sc.pool.unregister(sc.ConnID, reason) sc.dbConn.Recycle() sc.dbConn = nil sc.logReservedConn() diff --git a/go/vt/vttablet/tabletserver/stateful_connection_pool.go b/go/vt/vttablet/tabletserver/stateful_connection_pool.go index 64268825b70..88fbc56fd0c 100644 --- a/go/vt/vttablet/tabletserver/stateful_connection_pool.go +++ b/go/vt/vttablet/tabletserver/stateful_connection_pool.go @@ -96,7 +96,7 @@ func (sf *StatefulConnectionPool) Close() { log.Warningf("killing %s for shutdown: %s", thing, conn.String(sf.env.Config().SanitizeLogMessages, sf.env.Environment().Parser())) sf.env.Stats().InternalErrors.Add("StrayTransactions", 1) conn.Close() - conn.Releasef("pool closed") + conn.ReleaseString("pool closed") } sf.conns.Close() sf.foundRowsPool.Close() @@ -111,7 +111,7 @@ func (sf *StatefulConnectionPool) ShutdownNonTx() { return !sc.(*StatefulConnection).IsInTransaction() })) for _, sc := range conns { - sc.Releasef("kill non-tx") + sc.ReleaseString("kill non-tx") } } @@ -231,14 +231,14 @@ func (sf *StatefulConnectionPool) markAsNotInUse(sc *StatefulConnection, updateT switch sf.state.Load() { case scpKillingNonTx: if !sc.IsInTransaction() { - sc.Releasef("kill non-tx") + sc.ReleaseString("kill non-tx") return } case scpKillingAll: if sc.IsInTransaction() { sc.Close() } - sc.Releasef("kill all") + sc.ReleaseString("kill all") return } if updateTime { diff --git a/go/vt/vttablet/tabletserver/tx_pool_test.go b/go/vt/vttablet/tabletserver/tx_pool_test.go index aa2d5b69e89..e80f1edb17f 100644 --- a/go/vt/vttablet/tabletserver/tx_pool_test.go +++ b/go/vt/vttablet/tabletserver/tx_pool_test.go @@ -365,7 +365,7 @@ func TestTxPoolGetConnRecentlyRemovedTransaction(t *testing.T) { assertErrorMatch := func(id int64, reason string) { conn, err := txPool.GetAndLock(id, "for query") if err == nil { // - conn.Releasef("fail") + conn.ReleaseString("fail") t.Errorf("expected to get an error") return } @@ -385,7 +385,7 @@ func TestTxPoolGetConnRecentlyRemovedTransaction(t *testing.T) { _, err := txPool.Commit(ctx, conn1) require.NoError(t, err) - conn1.Releasef("transaction committed") + conn1.ReleaseString("transaction committed") assertErrorMatch(id, "transaction committed") diff --git a/go/vt/vttablet/tabletserver/vstreamer/helper_event_test.go b/go/vt/vttablet/tabletserver/vstreamer/helper_event_test.go index 81f4d3f7975..dafa7f20af2 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/helper_event_test.go +++ b/go/vt/vttablet/tabletserver/vstreamer/helper_event_test.go @@ -158,10 +158,10 @@ func (s *TestRowEventSpec) String() string { TableName: s.table, } var rowChanges []*binlogdatapb.RowChange - if s.changes != nil && len(s.changes) > 0 { + if len(s.changes) > 0 { for _, c := range s.changes { rowChange := binlogdatapb.RowChange{} - if c.before != nil && len(c.before) > 0 { + if len(c.before) > 0 { rowChange.Before = &query.Row{} for _, val := range c.before { if val == sqltypes.NullStr { @@ -171,7 +171,7 @@ func (s *TestRowEventSpec) String() string { rowChange.Before.Values = append(rowChange.Before.Values, []byte(val)...) } } - if c.after != nil && len(c.after) > 0 { + if len(c.after) > 0 { rowChange.After = &query.Row{} for i, val := range c.after { if val == sqltypes.NullStr { diff --git a/go/vt/vttablet/tabletserver/vstreamer/vstreamer_test.go b/go/vt/vttablet/tabletserver/vstreamer/vstreamer_test.go index 4d9f66f1809..df565b8f18b 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/vstreamer_test.go +++ b/go/vt/vttablet/tabletserver/vstreamer/vstreamer_test.go @@ -51,10 +51,7 @@ func checkIfOptionIsSupported(t *testing.T, variable string) bool { qr, err := env.Mysqld.FetchSuperQuery(context.Background(), fmt.Sprintf("show variables like '%s'", variable)) require.NoError(t, err) require.NotNil(t, qr) - if qr.Rows != nil && len(qr.Rows) == 1 { - return true - } - return false + return len(qr.Rows) == 1 } // TestPlayerNoBlob sets up a new environment with mysql running with @@ -667,7 +664,7 @@ func TestVStreamCopyWithDifferentFilters(t *testing.T) { }() wg.Wait() if errGoroutine != nil { - t.Fatalf(errGoroutine.Error()) + t.Fatal(errGoroutine.Error()) } } diff --git a/go/vt/wrangler/keyspace.go b/go/vt/wrangler/keyspace.go index a5f7d6ae0bf..98551a084c9 100644 --- a/go/vt/wrangler/keyspace.go +++ b/go/vt/wrangler/keyspace.go @@ -19,6 +19,7 @@ package wrangler import ( "bytes" "context" + "errors" "fmt" "sync" "time" @@ -82,7 +83,7 @@ func (wr *Wrangler) validateNewWorkflow(ctx context.Context, keyspace, workflow return } if p3qr != nil && len(p3qr.Rows) != 0 { - allErrors.RecordError(vterrors.Wrap(fmt.Errorf(validation.msg), "validateWorkflowName.VReplicationExec")) + allErrors.RecordError(vterrors.Wrap(errors.New(validation.msg), "validateWorkflowName.VReplicationExec")) return } } diff --git a/go/vt/wrangler/materializer.go b/go/vt/wrangler/materializer.go index 9367c43c310..cc7ba3f1603 100644 --- a/go/vt/wrangler/materializer.go +++ b/go/vt/wrangler/materializer.go @@ -18,6 +18,7 @@ package wrangler import ( "context" + "errors" "fmt" "hash/fnv" "math" @@ -355,7 +356,7 @@ func (wr *Wrangler) MoveTables(ctx context.Context, workflow, sourceKeyspace, ta migrationID, strings.Join(tablets, ",")) msg += fmt.Sprintf("please review and delete it before proceeding and restart the workflow using the Workflow %s.%s start", workflow, targetKeyspace) - return fmt.Errorf(msg) + return errors.New(msg) } } if autoStart { diff --git a/go/vt/wrangler/testlib/version_test.go b/go/vt/wrangler/testlib/version_test.go index cf5f3fd1487..552f7f29c04 100644 --- a/go/vt/wrangler/testlib/version_test.go +++ b/go/vt/wrangler/testlib/version_test.go @@ -56,7 +56,7 @@ func expvarHandler(gitRev *string) func(http.ResponseWriter, *http.Request) { http.Error(w, fmt.Sprintf("cannot marshal json: %s", err), http.StatusInternalServerError) return } - fmt.Fprintf(w, string(result)+"\n") + fmt.Fprint(w, string(result)+"\n") } } diff --git a/go/vt/wrangler/traffic_switcher.go b/go/vt/wrangler/traffic_switcher.go index 448f4f99734..6c6bbd933a7 100644 --- a/go/vt/wrangler/traffic_switcher.go +++ b/go/vt/wrangler/traffic_switcher.go @@ -335,7 +335,7 @@ func (wr *Wrangler) SwitchReads(ctx context.Context, targetKeyspace, workflowNam cells []string, direction workflow.TrafficSwitchDirection, dryRun bool) (*[]string, error) { // Consistently handle errors by logging and returning them. handleError := func(message string, err error) (*[]string, error) { - werr := vterrors.Errorf(vtrpcpb.Code_INTERNAL, fmt.Sprintf("%s: %v", message, err)) + werr := vterrors.Errorf(vtrpcpb.Code_INTERNAL, "%s: %v", message, err) wr.Logger().Error(werr) return nil, werr } @@ -346,7 +346,7 @@ func (wr *Wrangler) SwitchReads(ctx context.Context, targetKeyspace, workflowNam } if ts == nil { errorMsg := fmt.Sprintf("workflow %s not found in keyspace %s", workflowName, targetKeyspace) - return handleError("failed to get the current state of the workflow", fmt.Errorf(errorMsg)) + return handleError("failed to get the current state of the workflow", errors.New(errorMsg)) } log.Infof("Switching reads: %s.%s tt %+v, cells %+v, workflow state: %+v", targetKeyspace, workflowName, servedTypes, cells, ws) var switchReplicas, switchRdonly bool @@ -478,7 +478,7 @@ func (wr *Wrangler) SwitchWrites(ctx context.Context, targetKeyspace, workflowNa cancel, reverse, reverseReplication bool, dryRun, initializeTargetSequences bool) (journalID int64, dryRunResults *[]string, err error) { // Consistently handle errors by logging and returning them. handleError := func(message string, err error) (int64, *[]string, error) { - werr := vterrors.Errorf(vtrpcpb.Code_INTERNAL, fmt.Sprintf("%s: %v", message, err)) + werr := vterrors.Errorf(vtrpcpb.Code_INTERNAL, "%s: %v", message, err) wr.Logger().Error(werr) return 0, nil, werr } @@ -490,7 +490,7 @@ func (wr *Wrangler) SwitchWrites(ctx context.Context, targetKeyspace, workflowNa } if ts == nil { errorMsg := fmt.Sprintf("workflow %s not found in keyspace %s", workflowName, targetKeyspace) - return handleError("failed to get the current workflow state", fmt.Errorf(errorMsg)) + return handleError("failed to get the current workflow state", errors.New(errorMsg)) } var sw iswitcher @@ -1723,7 +1723,7 @@ func doValidateWorkflowHasCompleted(ctx context.Context, ts *trafficSwitcher) er _ = ts.ForAllSources(func(source *workflow.MigrationSource) error { wg.Add(1) if source.GetShard().IsPrimaryServing { - rec.RecordError(fmt.Errorf(fmt.Sprintf("Shard %s is still serving", source.GetShard().ShardName()))) + rec.RecordError(fmt.Errorf("Shard %s is still serving", source.GetShard().ShardName())) } wg.Done() return nil diff --git a/go/vt/wrangler/workflow.go b/go/vt/wrangler/workflow.go index 6862f5f4d3f..6e74e4c9ebd 100644 --- a/go/vt/wrangler/workflow.go +++ b/go/vt/wrangler/workflow.go @@ -2,6 +2,7 @@ package wrangler import ( "context" + "errors" "fmt" "sort" "strings" @@ -114,7 +115,7 @@ func (wr *Wrangler) NewVReplicationWorkflow(ctx context.Context, workflowType VR return nil, err } log.Infof("Workflow state is %+v", ws) - if ts != nil { //Other than on create we need to get SourceKeyspace from the workflow + if ts != nil { // Other than on create we need to get SourceKeyspace from the workflow vrw.params.TargetKeyspace = ts.targetKeyspace vrw.params.Workflow = ts.workflow vrw.params.SourceKeyspace = ts.sourceKeyspace @@ -379,7 +380,7 @@ func (vrw *VReplicationWorkflow) Complete() (*[]string, error) { } if !ws.WritesSwitched || len(ws.ReplicaCellsNotSwitched) > 0 || len(ws.RdonlyCellsNotSwitched) > 0 { - return nil, fmt.Errorf(ErrWorkflowNotFullySwitched) + return nil, errors.New(ErrWorkflowNotFullySwitched) } var renameTable workflow.TableRemovalType if vrw.params.RenameTables { @@ -404,7 +405,7 @@ func (vrw *VReplicationWorkflow) Cancel() error { } if ws.WritesSwitched || len(ws.ReplicaCellsSwitched) > 0 || len(ws.RdonlyCellsSwitched) > 0 { - return fmt.Errorf(ErrWorkflowPartiallySwitched) + return errors.New(ErrWorkflowPartiallySwitched) } if _, err := vrw.wr.DropTargets(vrw.ctx, vrw.ws.TargetKeyspace, vrw.ws.Workflow, vrw.params.KeepData, vrw.params.KeepRoutingRules, false); err != nil { return err diff --git a/misc/errcheck_excludes.txt b/misc/errcheck_excludes.txt deleted file mode 100644 index fb689e26288..00000000000 --- a/misc/errcheck_excludes.txt +++ /dev/null @@ -1,49 +0,0 @@ -// This file contains one function signature per line, which errcheck should not warn about. -// -// The format for function signatures is `package.FunctionName`. -// The format for method signatures is `(package.Receiver).MethodName` for value receivers, -// and the format for pointer receivers is `(*package.Receiver).MethodName`. -// -// See https://github.com/kisielk/errcheck#excluding-functions for more details. - -flag.Set -(*flag.FlagSet).Parse -(flag.Value).Set - -fmt.Fprint -fmt.Fprintf - -io.WriteString(fmt.State) -io.WriteString(net/http.ResponseWriter) - -(net.Listener).Close -(net/http.ResponseWriter).Write - -(*os.File).Close -os.Remove -os.RemoveAll -os.Rename - -(*github.com/spf13/cobra.Command).Help -(*github.com/spf13/cobra.Command).MarkFlagRequired -(*github.com/spf13/cobra.Command).MarkPersistentFlagRequired -(*github.com/spf13/cobra.Command).MarkPersistentFlagFilename - -(*github.com/spf13/pflag.FlagSet).MarkDeprecated - -(*google.golang.org/grpc.ClientConn).Close -(*google.golang.org/grpc.Server).Serve - -(*vitess.io/vitess/go/bytes2.Buffer).Write -(*vitess.io/vitess/go/bytes2.Buffer).WriteByte -(*vitess.io/vitess/go/bytes2.Buffer).WriteString - -(vitess.io/vitess/go/sqltypes.BinWriter).Write - -vitess.io/vitess/go/vt/orchestrator/external/golib/log.Errore -vitess.io/vitess/go/vt/orchestrator/external/golib/log.Errorf -vitess.io/vitess/go/vt/orchestrator/external/golib/log.Fatal -vitess.io/vitess/go/vt/orchestrator/external/golib/log.Fatale -vitess.io/vitess/go/vt/orchestrator/external/golib/log.Fatalf - -(*vitess.io/vitess/go/vt/vttest.LocalCluster).TearDown diff --git a/misc/git/hooks/golangci-lint b/misc/git/hooks/golangci-lint index d152cb965a3..8a596dac507 100755 --- a/misc/git/hooks/golangci-lint +++ b/misc/git/hooks/golangci-lint @@ -13,18 +13,32 @@ # See the License for the specific language governing permissions and # limitations under the License. -GOLANGCI_LINT=$(command -v golangci-lint >/dev/null 2>&1) -if [ $? -eq 1 ]; then - echo "Downloading golangci-lint..." - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 +# Required version of golangci-lint +REQUIRED_VERSION="v1.60.1" + +# Check if golangci-lint is installed and capture the version +if ! command -v golangci-lint >/dev/null 2>&1; then + echo "golangci-lint not found. Installing version $REQUIRED_VERSION..." + go install github.com/golangci/golangci-lint/cmd/golangci-lint@$REQUIRED_VERSION +else + VERSION_OUTPUT=$(golangci-lint --version) + INSTALLED_VERSION=$(echo "$VERSION_OUTPUT" | sed -n 's/^golangci-lint has version \([v0-9.]*\).*/\1/p') + if [ "$INSTALLED_VERSION" != "$REQUIRED_VERSION" ]; then + echo "golangci-lint version $INSTALLED_VERSION found, but $REQUIRED_VERSION is required." + echo "Installing correct version $REQUIRED_VERSION..." + go install github.com/golangci/golangci-lint/cmd/golangci-lint@$REQUIRED_VERSION + fi fi +# Get list of Go files to lint gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '^go/.*\.go$') if [ -z "$gofiles" ]; then exit 0 fi +# Get unique directories of the Go files gopackages=$(echo "$gofiles" | xargs -n1 dirname | sort -u | paste -sd ' ' -) +# Lint the Go packages echo "Linting $gopackages" -golangci-lint run $gopackages +golangci-lint run $gopackages \ No newline at end of file diff --git a/test.go b/test.go index 360b231e889..448dd33d0f9 100755 --- a/test.go +++ b/test.go @@ -77,7 +77,7 @@ For example: // Flags var ( flavor = flag.String("flavor", "mysql80", "comma-separated bootstrap flavor(s) to run against (when using Docker mode). Available flavors: all,"+flavors) - bootstrapVersion = flag.String("bootstrap-version", "34", "the version identifier to use for the docker images") + bootstrapVersion = flag.String("bootstrap-version", "35", "the version identifier to use for the docker images") runCount = flag.Int("runs", 1, "run each test this many times") retryMax = flag.Int("retry", 3, "max number of retries, to detect flaky tests") logPass = flag.Bool("log-pass", false, "log test output even if it passes") diff --git a/test/templates/cluster_endtoend_test.tpl b/test/templates/cluster_endtoend_test.tpl index 332cb67fedc..cd0161d5595 100644 --- a/test/templates/cluster_endtoend_test.tpl +++ b/test/templates/cluster_endtoend_test.tpl @@ -87,7 +87,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/test/templates/cluster_endtoend_test_docker.tpl b/test/templates/cluster_endtoend_test_docker.tpl index 2b63e6d3516..f9c3a8df317 100644 --- a/test/templates/cluster_endtoend_test_docker.tpl +++ b/test/templates/cluster_endtoend_test_docker.tpl @@ -56,7 +56,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Tune the OS if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/test/templates/cluster_endtoend_test_mysql57.tpl b/test/templates/cluster_endtoend_test_mysql57.tpl index a29698da472..193d02b7326 100644 --- a/test/templates/cluster_endtoend_test_mysql57.tpl +++ b/test/templates/cluster_endtoend_test_mysql57.tpl @@ -92,7 +92,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/test/templates/cluster_vitess_tester.tpl b/test/templates/cluster_vitess_tester.tpl index 541bfd5c6a0..90e1eded521 100644 --- a/test/templates/cluster_vitess_tester.tpl +++ b/test/templates/cluster_vitess_tester.tpl @@ -71,7 +71,7 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v5 with: - go-version: 1.22.5 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' diff --git a/test/templates/dockerfile.tpl b/test/templates/dockerfile.tpl index 437971aa532..23d899441e4 100644 --- a/test/templates/dockerfile.tpl +++ b/test/templates/dockerfile.tpl @@ -1,4 +1,4 @@ -ARG bootstrap_version=34 +ARG bootstrap_version=35 ARG image="vitess/bootstrap:${bootstrap_version}-{{.Platform}}" FROM "${image}" diff --git a/test/templates/unit_test.tpl b/test/templates/unit_test.tpl index 21707a89e48..e819b6a3680 100644 --- a/test/templates/unit_test.tpl +++ b/test/templates/unit_test.tpl @@ -69,7 +69,7 @@ jobs: 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 + go-version: 1.23.0 - name: Set up python if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' diff --git a/tools/check_go_versions.sh b/tools/check_go_versions.sh index 3549cdc10e9..f586cd245e0 100755 --- a/tools/check_go_versions.sh +++ b/tools/check_go_versions.sh @@ -14,8 +14,10 @@ if [ -z "${GO_MOD_VERSION}" ]; then exit 1 fi -# ci workflows -TPL_GO_VERSIONS="$(awk '/go-version: /{print $(NF-0)}' .github/workflows/*.yml test/templates/*.tpl | sort -u)" +# ci workflows excluding upgrade/downgrade tests +TPL_GO_VERSIONS="$(find .github/workflows test/templates -type f \( -name '*.yml' -o -name '*.tpl' \) \ + ! -name 'upgrade_downgrade_test*.yml' \ + -exec awk '/go-version: /{print $(NF-0)}' {} + | sort -u)" TPL_GO_VERSIONS_COUNT=$(echo "$TPL_GO_VERSIONS" | wc -l | tr -d [:space:]) if [ "${TPL_GO_VERSIONS_COUNT}" -gt 1 ]; then echo -e "expected a consistent 'go-version:' in CI workflow files/templates, found versions:\n${TPL_GO_VERSIONS}" @@ -35,4 +37,4 @@ if [[ ! "${BOOTSTRAP_GO_VERSION}" =~ "${GO_MOD_VERSION}" ]]; then elif [ "${TPL_GO_VERSION}" != "${BOOTSTRAP_GO_VERSION}" ]; then echo "expected equal go version in CI workflow files/templates and bootstrap Dockerfile: '${TPL_GO_VERSIONS}' != '${BOOTSTRAP_GO_VERSION}'" exit 1 -fi +fi \ No newline at end of file diff --git a/vitess-mixin/go.mod b/vitess-mixin/go.mod index 20d3f33eed8..a3a98d72d63 100644 --- a/vitess-mixin/go.mod +++ b/vitess-mixin/go.mod @@ -1,6 +1,6 @@ module vitess-mixin -go 1.22.5 +go 1.23 require ( github.com/evanphx/json-patch v5.9.0+incompatible @@ -130,3 +130,4 @@ require ( ) replace k8s.io/client-go v2.0.0-alpha.0.0.20181121191925-a47917edff34+incompatible => k8s.io/client-go v2.0.0-alpha.1+incompatible +e