summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-08-02 11:12:11 +0200
committerunknown <serg@serg.mylan>2004-08-02 11:12:11 +0200
commitea8ac8ab9845e039e5770821c5dbfc4604390299 (patch)
tree695c5281bfa4bfd124f93bb91176c94e73bcc89c /sql/sql_base.cc
parent3c1327021a837257b3b75a75ae2bc92acae6d719 (diff)
downloadmariadb-git-ea8ac8ab9845e039e5770821c5dbfc4604390299.tar.gz
hang in dummy natural join (no common columns) Bug #4807
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc47
1 files changed, 25 insertions, 22 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 1a923b2410a..dd8283e057a 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2522,29 +2522,32 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
// to prevent natural join processing during PS re-execution
table->natural_join= 0;
- if (!table->outer_join) // Not left join
+ if (cond_and->list.elements)
{
- *conds= and_conds(*conds, cond_and);
- // fix_fields() should be made with temporary memory pool
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
- if (*conds && !(*conds)->fixed)
- {
- if ((*conds)->fix_fields(thd, tables, conds))
- DBUG_RETURN(1);
- }
- }
- else
- {
- table->on_expr= and_conds(table->on_expr, cond_and);
- // fix_fields() should be made with temporary memory pool
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
- if (table->on_expr && !table->on_expr->fixed)
- {
- if (table->on_expr->fix_fields(thd, tables, &table->on_expr))
- DBUG_RETURN(1);
- }
+ if (!table->outer_join) // Not left join
+ {
+ *conds= and_conds(*conds, cond_and);
+ // fix_fields() should be made with temporary memory pool
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ if (*conds && !(*conds)->fixed)
+ {
+ if ((*conds)->fix_fields(thd, tables, conds))
+ DBUG_RETURN(1);
+ }
+ }
+ else
+ {
+ table->on_expr= and_conds(table->on_expr, cond_and);
+ // fix_fields() should be made with temporary memory pool
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ if (table->on_expr && !table->on_expr->fixed)
+ {
+ if (table->on_expr->fix_fields(thd, tables, &table->on_expr))
+ DBUG_RETURN(1);
+ }
+ }
}
}
}