1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Preparatory (and the most problematic) patch for Bug#7306

"the server side preparedStatement error for LIMIT placeholder",
which moves all uses of LIMIT clause from PREPARE to OPTIMIZE
and later steps.
After-review fixes.
This commit is contained in:
konstantin@mysql.com
2005-05-30 20:54:37 +04:00
parent 248a6934bb
commit 2d6a70c42a
17 changed files with 69 additions and 104 deletions

View File

@ -7982,8 +7982,17 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_key_stat()
}
}
}
else if (have_min && min_max_arg_part && min_max_arg_part->field->is_null())
else if (have_min && min_max_arg_part &&
min_max_arg_part->field->real_maybe_null())
{
/*
If a MIN/MAX argument value is NULL, we can quickly determine
that we're in the beginning of the next group, because NULLs
are always < any other value. This allows us to quickly
determine the end of the current group and jump to the next
group (see next_min()) and thus effectively increases the
usable key length.
*/
max_used_key_length+= min_max_arg_len;
++used_key_parts;
}