diff --git a/sql/sql_select.h b/sql/sql_select.h index 0214c290ff7..0f3eb19ad82 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -2598,15 +2598,7 @@ void propagate_new_equalities(THD *thd, Item *cond, COND_EQUAL *inherited, bool *is_simplifiable_cond); -template T prev_bits(T n_bits) -{ - if (!n_bits) - return 0; - T tmp= ((T)1 << (n_bits - 1)); - return (tmp - 1) | tmp; -} -// A wrapper for the above function: -#define PREV_BITS(type, A) prev_bits(A) +#define PREV_BITS(type, N_BITS) ((type)my_set_bits(N_BITS)) #endif /* SQL_SELECT_INCLUDED */