mirror of
https://github.com/MariaDB/server.git
synced 2026-04-19 14:55:32 +02:00
MDEV-34392 Inplace algorithm violates the foreign key constraint
- Fix the compilation error in gcc-5
This commit is contained in:
parent
706a8bcb5b
commit
65418ca9ad
3 changed files with 23 additions and 3 deletions
11
sql/table.h
11
sql/table.h
|
|
@ -1927,7 +1927,14 @@ public:
|
|||
DBUG_ASSERT(fields_nullable);
|
||||
DBUG_ASSERT(field < n_fields);
|
||||
size_t bit= size_t{field} + referenced * n_fields;
|
||||
fields_nullable[bit / 8]|= (unsigned char)(1 << (bit % 8));
|
||||
#if defined __GNUC__ && __GNUC__ == 5
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wconversion"
|
||||
#endif
|
||||
fields_nullable[bit / 8]|= static_cast<unsigned char>(1 << (bit % 8));
|
||||
#if defined __GNUC__ && __GNUC__ == 5
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1944,7 +1951,7 @@ public:
|
|||
unsigned n_field= get_n_fields();
|
||||
DBUG_ASSERT(field < n_field);
|
||||
size_t bit= size_t{field} + referenced * n_field;
|
||||
return fields_nullable[bit / 8] & (1 << (bit % 8));
|
||||
return fields_nullable[bit / 8] & (1U << (bit % 8));
|
||||
}
|
||||
|
||||
} FOREIGN_KEY_INFO;
|
||||
|
|
|
|||
|
|
@ -12518,7 +12518,10 @@ create_table_info_t::create_foreign_keys()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ == 5
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wconversion"
|
||||
#endif
|
||||
switch (fk->delete_opt) {
|
||||
case FK_OPTION_UNDEF:
|
||||
case FK_OPTION_RESTRICT:
|
||||
|
|
@ -12560,6 +12563,9 @@ create_table_info_t::create_foreign_keys()
|
|||
ut_ad(0);
|
||||
break;
|
||||
}
|
||||
#if defined __GNUC__ && __GNUC__ == 5
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
if (dict_foreigns_has_s_base_col(local_fk_set, table)) {
|
||||
|
|
|
|||
|
|
@ -2807,6 +2807,10 @@ innobase_set_foreign_key_option(
|
|||
break;
|
||||
}
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ == 5
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wconversion"
|
||||
#endif
|
||||
switch (fk_key->update_opt) {
|
||||
case FK_OPTION_NO_ACTION:
|
||||
case FK_OPTION_RESTRICT:
|
||||
|
|
@ -2823,6 +2827,9 @@ innobase_set_foreign_key_option(
|
|||
break;
|
||||
}
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ == 5
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
return(innobase_check_fk_option(foreign));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue