When I've tried to remove HA_NULL_PART flag completely (so that we don't have checks for something we don't set)
I discovered that the flag is used in MyISAM under some circumstances.
So, the solution is:
* Put the code that sets HA_NULL_PART flag back.
* Modify the check in part_of_refkey() so that it
1. removes the equality in case P1
2. keeps the equality in case P2
in other words:
1. NULL-ability of the lookup column should not prevent the removal of ref-equality.
2. but if ref_or_null access will alternate the column's value between the lookup value and NULL, then the equality should not be removed.
What is in the fix ------- ------- ----
-------
When I've tried to remove HA_NULL_PART flag completely (so that we don't have checks for something we don't set)
I discovered that the flag is used in MyISAM under some circumstances.
So, the solution is:
* Put the code that sets HA_NULL_PART flag back.
* Modify the check in part_of_refkey() so that it
1. removes the equality in case P1
2. keeps the equality in case P2
in other words:
1. NULL-ability of the lookup column should not prevent the removal of ref-equality.
2. but if ref_or_null access will alternate the column's value between the lookup value and NULL, then the equality should not be removed.