Commit d9200923 authored by Sergei Golubchik's avatar Sergei Golubchik

a couple of minor post-5.5-merge cleanups

include/mysql_com.h:
  remove "shutdown levels" that aren't shutdown levels from mysql_enum_shutdown_level
mysys/my_addr_resolve.c:
  my_snprintf in 5.5 (but not in 5.3) supports %p
sql/item_func.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/item_subselect.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/opt_subselect.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/sql_select.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
parent 485e7264
...@@ -66,9 +66,7 @@ enum mysql_enum_shutdown_level { ...@@ -66,9 +66,7 @@ enum mysql_enum_shutdown_level {
SHUTDOWN_WAIT_TRANSACTIONS= (unsigned char)(1 << 1), SHUTDOWN_WAIT_TRANSACTIONS= (unsigned char)(1 << 1),
SHUTDOWN_WAIT_UPDATES= (unsigned char)(1 << 3), SHUTDOWN_WAIT_UPDATES= (unsigned char)(1 << 3),
SHUTDOWN_WAIT_ALL_BUFFERS= ((unsigned char)(1 << 3) << 1), SHUTDOWN_WAIT_ALL_BUFFERS= ((unsigned char)(1 << 3) << 1),
SHUTDOWN_WAIT_CRITICAL_BUFFERS= ((unsigned char)(1 << 3) << 1) + 1, SHUTDOWN_WAIT_CRITICAL_BUFFERS= ((unsigned char)(1 << 3) << 1) + 1
SHUTDOWN_KILL_QUERY= 254,
SHUTDOWN_KILL_CONNECTION= 255
}; };
enum enum_cursor_type enum enum_cursor_type
{ {
......
...@@ -435,10 +435,7 @@ enum mysql_enum_shutdown_level { ...@@ -435,10 +435,7 @@ enum mysql_enum_shutdown_level {
/* flush InnoDB buffers and other storage engines' buffers*/ /* flush InnoDB buffers and other storage engines' buffers*/
SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1), SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1),
/* don't flush InnoDB buffers, flush other storage engines' buffers*/ /* don't flush InnoDB buffers, flush other storage engines' buffers*/
SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1, SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1
/* Now the 2 levels of the KILL command */
SHUTDOWN_KILL_QUERY= 254,
SHUTDOWN_KILL_CONNECTION= 255
}; };
/* Compatibility */ /* Compatibility */
......
...@@ -140,7 +140,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) ...@@ -140,7 +140,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
char output[1024]; char output[1024];
size_t len; size_t len;
len= snprintf(input, sizeof(input), "0x%p\n", ptr); len= my_snprintf(input, sizeof(input), "%p\n", ptr);
if (write(in[1], input, len) <= 0) if (write(in[1], input, len) <= 0)
return 1; return 1;
if (read(out[0], output, sizeof(output)) <= 0) if (read(out[0], output, sizeof(output)) <= 0)
......
...@@ -6733,7 +6733,7 @@ Item_func_sp::fix_fields(THD *thd, Item **ref) ...@@ -6733,7 +6733,7 @@ Item_func_sp::fix_fields(THD *thd, Item **ref)
if (res) if (res)
DBUG_RETURN(res); DBUG_RETURN(res);
if (thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW) if (thd->lex->is_view_context_analysis())
{ {
/* /*
Here we check privileges of the stored routine only during view Here we check privileges of the stored routine only during view
......
...@@ -2508,7 +2508,7 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref) ...@@ -2508,7 +2508,7 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
} }
} }
if ((thd_arg->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW) && if (thd_arg->lex->is_view_context_analysis() &&
left_expr && !left_expr->fixed && left_expr && !left_expr->fixed &&
left_expr->fix_fields(thd_arg, &left_expr)) left_expr->fix_fields(thd_arg, &left_expr))
return TRUE; return TRUE;
......
...@@ -346,8 +346,8 @@ int check_and_do_in_subquery_rewrites(JOIN *join) ...@@ -346,8 +346,8 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
TODO: for PS, make the whole block execute only on the first execution TODO: for PS, make the whole block execute only on the first execution
*/ */
Item_subselect *subselect; Item_subselect *subselect;
if (!(thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW) && // (1) if (!thd->lex->is_view_context_analysis() && // (1)
(subselect= parent_unit->item)) // (2) (subselect= parent_unit->item)) // (2)
{ {
Item_in_subselect *in_subs= NULL; Item_in_subselect *in_subs= NULL;
Item_allany_subselect *allany_subs= NULL; Item_allany_subselect *allany_subs= NULL;
......
...@@ -643,7 +643,7 @@ JOIN::prepare(Item ***rref_pointer_array, ...@@ -643,7 +643,7 @@ JOIN::prepare(Item ***rref_pointer_array,
*/ */
if (select_lex->master_unit()->item && // 1) if (select_lex->master_unit()->item && // 1)
select_lex->first_cond_optimization && // 2) select_lex->first_cond_optimization && // 2)
!(thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW)) // 3) !thd->lex->is_view_context_analysis()) // 3)
{ {
remove_redundant_subquery_clauses(select_lex); remove_redundant_subquery_clauses(select_lex);
} }
......
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