vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.42k stars 2.08k forks source link

Bug Report: Changes to make foreign key checks Vitess Aware don't work with MySQL 5.7 #14631

Closed GuptaManan100 closed 9 months ago

GuptaManan100 commented 9 months ago

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 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.

Binary Version

main

Operating System and Environment details

-

Log Fragments

No response

GuptaManan100 commented 9 months ago

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.