summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 8cb4f26c429..c2cc2070347 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/* Some general useful functions */
@@ -4187,6 +4187,7 @@ bool TABLE_LIST::prep_where(THD *thd, Item **conds,
bool no_where_clause)
{
DBUG_ENTER("TABLE_LIST::prep_where");
+ bool res= FALSE;
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
@@ -4235,10 +4236,11 @@ bool TABLE_LIST::prep_where(THD *thd, Item **conds,
if (tbl == 0)
{
if (*conds && !(*conds)->fixed)
- (*conds)->fix_fields(thd, conds);
- *conds= and_conds(*conds, where->copy_andor_structure(thd));
- if (*conds && !(*conds)->fixed)
- (*conds)->fix_fields(thd, conds);
+ res= (*conds)->fix_fields(thd, conds);
+ if (!res)
+ *conds= and_conds(*conds, where->copy_andor_structure(thd));
+ if (*conds && !(*conds)->fixed && !res)
+ res= (*conds)->fix_fields(thd, conds);
}
if (arena)
thd->restore_active_arena(arena, &backup);
@@ -4246,7 +4248,7 @@ bool TABLE_LIST::prep_where(THD *thd, Item **conds,
}
}
- DBUG_RETURN(FALSE);
+ DBUG_RETURN(res);
}
/**