Commit df82d684 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup

remove casts. uchar can store 1/0 as good as bool.
parent 1e6ad0ce
...@@ -7225,7 +7225,7 @@ bool Item_null::send(Protocol *protocol, st_value *buffer) ...@@ -7225,7 +7225,7 @@ bool Item_null::send(Protocol *protocol, st_value *buffer)
bool Item::cache_const_expr_analyzer(uchar **arg) bool Item::cache_const_expr_analyzer(uchar **arg)
{ {
bool *cache_flag= (bool*)*arg; uchar *cache_flag= *arg;
if (!*cache_flag) if (!*cache_flag)
{ {
Item *item= real_item(); Item *item= real_item();
...@@ -7264,9 +7264,9 @@ bool Item::cache_const_expr_analyzer(uchar **arg) ...@@ -7264,9 +7264,9 @@ bool Item::cache_const_expr_analyzer(uchar **arg)
Item* Item::cache_const_expr_transformer(THD *thd, uchar *arg) Item* Item::cache_const_expr_transformer(THD *thd, uchar *arg)
{ {
if (*(bool*)arg) if (*arg)
{ {
*((bool*)arg)= FALSE; *arg= FALSE;
Item_cache *cache= get_cache(thd); Item_cache *cache= get_cache(thd);
if (!cache) if (!cache)
return NULL; return NULL;
......
...@@ -28287,20 +28287,20 @@ JOIN::reoptimize(Item *added_where, table_map join_tables, ...@@ -28287,20 +28287,20 @@ JOIN::reoptimize(Item *added_where, table_map join_tables,
void JOIN::cache_const_exprs() void JOIN::cache_const_exprs()
{ {
bool cache_flag= FALSE; uchar cache_flag= FALSE;
bool *analyzer_arg= &cache_flag; uchar *analyzer_arg= &cache_flag;
/* No need in cache if all tables are constant. */ /* No need in cache if all tables are constant. */
if (const_tables == table_count) if (const_tables == table_count)
return; return;
if (conds) if (conds)
conds->compile(thd, &Item::cache_const_expr_analyzer, (uchar **)&analyzer_arg, conds->compile(thd, &Item::cache_const_expr_analyzer, &analyzer_arg,
&Item::cache_const_expr_transformer, (uchar *)&cache_flag); &Item::cache_const_expr_transformer, &cache_flag);
cache_flag= FALSE; cache_flag= FALSE;
if (having) if (having)
having->compile(thd, &Item::cache_const_expr_analyzer, (uchar **)&analyzer_arg, having->compile(thd, &Item::cache_const_expr_analyzer,
&Item::cache_const_expr_transformer, (uchar *)&cache_flag); &analyzer_arg, &Item::cache_const_expr_transformer, &cache_flag);
for (JOIN_TAB *tab= first_depth_first_tab(this); tab; for (JOIN_TAB *tab= first_depth_first_tab(this); tab;
tab= next_depth_first_tab(this, tab)) tab= next_depth_first_tab(this, tab))
...@@ -28309,9 +28309,7 @@ void JOIN::cache_const_exprs() ...@@ -28309,9 +28309,7 @@ void JOIN::cache_const_exprs()
{ {
cache_flag= FALSE; cache_flag= FALSE;
(*tab->on_expr_ref)->compile(thd, &Item::cache_const_expr_analyzer, (*tab->on_expr_ref)->compile(thd, &Item::cache_const_expr_analyzer,
(uchar **)&analyzer_arg, &analyzer_arg, &Item::cache_const_expr_transformer, &cache_flag);
&Item::cache_const_expr_transformer,
(uchar *)&cache_flag);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment