1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
This performance degradation for UPDATEs could be observed in the update
statements for which the search key cannot be converted to any valid
value of the type of the search column, like for a  the condition
int_fld=99999999999999999999999999, though it can be guaranteed here
that there is no row with such a key value.
This commit is contained in:
igor@olga.mysql.com
2007-02-02 15:22:10 -08:00
parent d1185aaeaf
commit 215b0a95e1
3 changed files with 108 additions and 1 deletions

View File

@ -4296,7 +4296,22 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
err= value->save_in_field_no_warnings(field, 1);
if (err > 0 && field->cmp_type() != value->result_type())
{
tree= 0;
if ((type == Item_func::EQ_FUNC || type == Item_func::EQUAL_FUNC) &&
value->result_type() == item_cmp_type(field->result_type(),
value->result_type()))
{
tree= new (alloc) SEL_ARG(field, 0, 0);
tree->type= SEL_ARG::IMPOSSIBLE;
}
else
{
/*
TODO: We should return trees of the type SEL_ARG::IMPOSSIBLE
for the cases like int_field > 999999999999999999999999 as well.
*/
tree= 0;
}
goto end;
}
if (err < 0)