From: adm ti a. <us...@au...> - 2025-02-23 14:42:11
|
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> <font face="Ubuntu Mono">hi!<br> <br> This url [<a class="moz-txt-link-freetext" href="https://bugs.mysql.com/bug.php?id=114838">https://bugs.mysql.com/bug.php?id=114838</a>] show how to disable <br> </font> <pre class="note">There is a seemingly undocumented variable introduced in MySQL 8.4 "RESTRICT_FK_ON_NON_STANDARD_KEY" which is enabled by default. "Disallow the creation of foreign keys referencing non-unique key" </pre> <div id="c543064" class="comment"> <div class="header"> [7 May 2024 20:04] Evan Elias </div> <pre class="note">Wow, excellent find. Strangely, not only is that new variable undocumented, but it is also deprecated. If you disable it, a warning is issued: <font size="5">mysql> SET restrict_fk_on_non_standard_key = OFF;</font> Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> SHOW WARNINGS\G *************************** 1. row *************************** Level: Warning Code: 4166 Message: 'restrict_fk_on_non_standard_key' is deprecated and will be removed in a future release. Foreign key referring to non-unique or partial keys is unsafe and may break replication. 1 row in set (0.00 sec) please in your mysql environment run SET restrict_fk_on_non_standard_key = OFF; regards. </pre> </div> </body> </html> |