Details
Description
Reproduce
select @@foreign_key_checks; |
set foreign_key_checks= default; |
select @@foreign_key_checks; |
Result
select @@foreign_key_checks; |
@@foreign_key_checks
|
1
|
set foreign_key_checks= default; |
select @@foreign_key_checks; |
@@foreign_key_checks
|
0
|
Expected
foreign_key_checks has default value of 1
Tests affected
innodb.foreign_key
Cause
session_save_default() ignores reverse_semantics setting:
++
|
1852 void session_save_default(THD *thd, set_var *var) |
1853 { var->save_result.ulonglong_value= global_var(ulonglong) & bitmask; }
|
global_var(ulonglong) has OPTION_NO_FOREIGN_KEY_CHECKS bit 0.
var->save_result.ulonglong_value has foreign_key_checks semantics!
Then:
++
|
1809 class Sys_var_bit: public Sys_var_typelib |
1810 {
|
1811 ulonglong bitmask;
|
1812 bool reverse_semantics; |
1813 void set(uchar *ptr, ulonglong value) |
1814 {
|
1815 if ((value != 0) ^ reverse_semantics) |
1816 (*(ulonglong *)ptr)|= bitmask;
|
1817 else |
1818 (*(ulonglong *)ptr)&= ~bitmask;
|
1819 }
|
Attachments
Issue Links
- blocks
-
MDEV-16417 Store Foreign Key metadata outside of InnoDB
- In Review