1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-35445 Disable foreign key column nullability check for strict sql mode

- MDEV-34392(commit cc810e64d4) adds
the check for nullability of foreign key column when foreign key
relation is of UPDATE_CASCADE or UPDATE SET NULL. This check
makes DDL fail when it violates foreign key nullability.
This patch basically does the nullability check for foreign key
column only for strict sql mode
This commit is contained in:
Thirunarayanan Balathandayuthapani
2025-01-21 18:52:33 +05:30
parent b056ed6d98
commit 0301ef38b4
9 changed files with 364 additions and 8 deletions

View File

@@ -9677,6 +9677,7 @@ fk_check_column_changes(THD *thd, const TABLE *table,
*bad_column_name= NULL;
enum fk_column_change_type result= FK_COLUMN_NO_CHANGE;
bool strict_mode= thd->is_strict_mode();
while ((column= column_it++))
{
@@ -9722,7 +9723,7 @@ fk_check_column_changes(THD *thd, const TABLE *table,
goto func_exit;
}
if (old_field_not_null != new_field_not_null)
if (strict_mode && old_field_not_null != new_field_not_null)
{
if (referenced && !new_field_not_null)
{