Commit 9c770851 authored by Sergey Petrunya's avatar Sergey Petrunya

BUG#727667 Wrong result with OR + NOT NULL in maria-5.3

- Address review feedback: introduce NO_REF_PART symbolic name, better comments
parent 6aae42a3
......@@ -6564,12 +6564,12 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j,
j->ref.has_record= FALSE;
j->ref.null_rejecting= 0;
j->ref.disable_cache= FALSE;
j->ref.null_ref_part= (uint)-1;
j->ref.null_ref_part= NO_REF_PART;
keyuse=org_keyuse;
store_key **ref_key= j->ref.key_copy;
uchar *key_buff=j->ref.key_buff, *null_ref_key= 0;
uint null_ref_part= (uint)-1;
uint null_ref_part= NO_REF_PART;
bool keyuse_uses_no_tables= TRUE;
if (ftkey)
{
......
......@@ -79,6 +79,8 @@ typedef struct keyuse_t {
class store_key;
const int NO_REF_PART= uint(-1);
typedef struct st_table_ref
{
bool key_err;
......@@ -113,8 +115,9 @@ typedef struct st_table_ref
/* null byte position in the key_buf. Used for REF_OR_NULL optimization */
uchar *null_ref_key;
/*
ref_or_null optimization: number of key part can be NULL (there's only one)
uint(-1) if no part can be NULL.
ref_or_null optimization: number of key part that alternates between
the lookup value or NULL (there's only one such part).
If we're not using ref_or_null, the value is NO_REF_PART
*/
uint null_ref_part;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment