1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Automerge of mysql-5.1-bugteam to mysql-trunk-merge.

This commit is contained in:
Alexey Kopytov
2010-04-11 11:17:42 +04:00
22 changed files with 221 additions and 18 deletions

View File

@ -1128,13 +1128,13 @@ JOIN::optimize()
elements may be lost during further having
condition transformation in JOIN::exec.
*/
if (having && !having->with_sum_func)
if (having && const_table_map)
{
COND *const_cond= make_cond_for_table(having, const_table_map, 0);
DBUG_EXECUTE("where", print_where(const_cond, "const_having_cond",
QT_ORDINARY););
if (const_cond && !const_cond->val_int())
having->update_used_tables();
having= remove_eq_conds(thd, having, &having_value);
if (having_value == Item::COND_FALSE)
{
having= new Item_int((longlong) 0,1);
zero_result_cause= "Impossible HAVING noticed after reading const tables";
error= 0;
DBUG_RETURN(0);