The changes made in https://github.com/vitessio/vitess/pull/14484 to make FOREIGN_KEY_CHECKS a Vitess Aware Variable don't work with MySQL 5.7 because it doesn't support SET_VAR optimiser hints. The changes in that PR rely on the optimiser hint working since they replace SET FOREIGN_KEY_CHECKS commands to instead set optimiser hints on the subsequent queries.
Reproduction Steps
Run the latest vitess code from main.
Execute SET FOREIGN_KEY_CHECKS = 0 and then run a query which inserts data violating a foreign key constraint.
We no longer intend to support MySQL 5.7 in Vitess releases from v19 onwards. We will however continue supporting importing from MySQL 5.7. The changes made to Vitess are okay for this use-case.
Overview of the Issue
The changes made in https://github.com/vitessio/vitess/pull/14484 to make
FOREIGN_KEY_CHECKS
a Vitess Aware Variable don't work with MySQL 5.7 because it doesn't supportSET_VAR
optimiser hints. The changes in that PR rely on the optimiser hint working since they replaceSET FOREIGN_KEY_CHECKS
commands to instead set optimiser hints on the subsequent queries.Reproduction Steps
Run the latest vitess code from main. Execute
SET FOREIGN_KEY_CHECKS = 0
and then run a query which inserts data violating a foreign key constraint.Binary Version
Operating System and Environment details
Log Fragments
No response