From ae79dbdb958ba49cff46a7b104bf1011b23c3788 Mon Sep 17 00:00:00 2001
From: Sergey Petrunya <psergey@askmonty.org>
Date: Wed, 12 Oct 2011 21:38:40 +0400
Subject: [PATCH] Code cleanup: move variable into branch that uses it

---
 sql/sql_select.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 4b4daae3d2d..36d2eac6dbc 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -19895,7 +19895,6 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
     DBUG_RETURN(FALSE);
 
   Item_cond_and *cond=new Item_cond_and();
-  Item *cond_copy;
   TABLE *table=join_tab->table;
   int error= 0;
   if (!cond)
@@ -19918,6 +19917,7 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
   }
   if (join_tab->select)
   {
+    Item *cond_copy;
     UNINIT_VAR(cond_copy); // used when pre_idx_push_select_cond!=NULL
     if (join_tab->select->pre_idx_push_select_cond)
       cond_copy= cond->copy_andor_structure(thd);
-- 
2.30.9