1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-6105: Emoji unicode character string search query makes mariadb performance down

- When range optimizer cannot the lookup value into [VAR]CHAR(n) column,
  it should produce:
  = "Impossible range" for equality
  = "no range" for non-equalities.
This commit is contained in:
Sergey Petrunya
2014-06-05 19:18:35 +04:00
parent 7d3a67a976
commit c7e5a1f70d
3 changed files with 103 additions and 0 deletions

View File

@@ -7775,6 +7775,17 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
if (field->cmp_type() == STRING_RESULT && value->cmp_type() != STRING_RESULT)
goto end;
err= value->save_in_field_no_warnings(field, 1);
if (err == 2 && field->cmp_type() == STRING_RESULT)
{
if (type == Item_func::EQ_FUNC)
{
tree= new (alloc) SEL_ARG(field, 0, 0);
tree->type= SEL_ARG::IMPOSSIBLE;
}
else
tree= NULL; /* Cannot infer anything */
goto end;
}
if (err > 0)
{
if (field->cmp_type() != value->result_type())