mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
select.result:
After revision of the fix for bug #7520. table.cc: Revised the fix for bug #7520. Made it compliant with 5.0 code where the bug does not exist. sql/table.cc: Revised the fix for bug #7520. Made it compliant with 5.0 code where the bug does not exist. mysql-test/r/select.result: After revision of the fix for bug #7520.
This commit is contained in:
@ -2371,7 +2371,7 @@ INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
|
|||||||
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
|
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
|
||||||
table type possible_keys key key_len ref rows Extra
|
table type possible_keys key key_len ref rows Extra
|
||||||
t1 ALL NULL NULL NULL NULL 5
|
t1 ALL NULL NULL NULL NULL 5
|
||||||
t2 ref a a 23 t1.a 5
|
t2 ALL a NULL NULL NULL 4
|
||||||
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
|
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
|
||||||
table type possible_keys key key_len ref rows Extra
|
table type possible_keys key key_len ref rows Extra
|
||||||
t1 ALL NULL NULL NULL NULL 5
|
t1 ALL NULL NULL NULL NULL 5
|
||||||
|
13
sql/table.cc
13
sql/table.cc
@ -143,7 +143,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||||||
goto err_not_open; /* purecov: inspected */
|
goto err_not_open; /* purecov: inspected */
|
||||||
bzero((char*) keyinfo,n_length);
|
bzero((char*) keyinfo,n_length);
|
||||||
outparam->key_info=keyinfo;
|
outparam->key_info=keyinfo;
|
||||||
outparam->max_key_length= outparam->total_key_length= 0;
|
|
||||||
key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys);
|
key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys);
|
||||||
strpos=disk_buff+6;
|
strpos=disk_buff+6;
|
||||||
|
|
||||||
@ -199,11 +198,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||||||
}
|
}
|
||||||
key_part->store_length=key_part->length;
|
key_part->store_length=key_part->length;
|
||||||
}
|
}
|
||||||
set_if_bigger(outparam->max_key_length,keyinfo->key_length+
|
|
||||||
keyinfo->key_parts);
|
|
||||||
outparam->total_key_length+= keyinfo->key_length;
|
|
||||||
if (keyinfo->flags & HA_NOSAME)
|
|
||||||
set_if_bigger(outparam->max_unique_length,keyinfo->key_length);
|
|
||||||
}
|
}
|
||||||
keynames=(char*) key_part;
|
keynames=(char*) key_part;
|
||||||
strpos+= (strmov(keynames, (char *) strpos) - keynames)+1;
|
strpos+= (strmov(keynames, (char *) strpos) - keynames)+1;
|
||||||
@ -486,7 +480,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||||||
if (!(field->flags & BINARY_FLAG))
|
if (!(field->flags & BINARY_FLAG))
|
||||||
keyinfo->flags|= HA_END_SPACE_KEY;
|
keyinfo->flags|= HA_END_SPACE_KEY;
|
||||||
}
|
}
|
||||||
set_if_bigger(outparam->max_key_length, keyinfo->key_length);
|
|
||||||
if (i == 0 && key != primary_key)
|
if (i == 0 && key != primary_key)
|
||||||
field->flags |=
|
field->flags |=
|
||||||
((keyinfo->flags & HA_NOSAME) &&
|
((keyinfo->flags & HA_NOSAME) &&
|
||||||
@ -547,6 +540,12 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
keyinfo->usable_key_parts=usable_parts; // Filesort
|
keyinfo->usable_key_parts=usable_parts; // Filesort
|
||||||
|
|
||||||
|
set_if_bigger(outparam->max_key_length,keyinfo->key_length+
|
||||||
|
keyinfo->key_parts);
|
||||||
|
outparam->total_key_length+= keyinfo->key_length;
|
||||||
|
if (keyinfo->flags & HA_NOSAME)
|
||||||
|
set_if_bigger(outparam->max_unique_length,keyinfo->key_length);
|
||||||
}
|
}
|
||||||
if (primary_key < MAX_KEY &&
|
if (primary_key < MAX_KEY &&
|
||||||
(outparam->keys_in_use & ((key_map) 1 << primary_key)))
|
(outparam->keys_in_use & ((key_map) 1 << primary_key)))
|
||||||
|
Reference in New Issue
Block a user