Commit 7f974e5a authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: remove redundant BANG_PRECEDENCE

prefix unary operators don't need to have different precedence,
the syntax unambiguously specifies in what order they apply
parent 8c83e6ea
......@@ -8068,7 +8068,7 @@ select !cast(1 as char charset binary) AS `! BINARY 1`,cast(!1 as char charset b
create or replace view v1 as select ! ~ 1, ~ ! 1;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
select !(~1) AS `! ~ 1`,~!1 AS `~ ! 1`
select !~1 AS `! ~ 1`,~!1 AS `~ ! 1`
create or replace view v1 as select - BINARY 1, BINARY - 1;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
......
......@@ -92,8 +92,7 @@ enum precedence {
MUL_PRECEDENCE, // *, /, DIV, %, MOD
BITXOR_PRECEDENCE, // ^
PIPES_PRECEDENCE, // || (if PIPES_AS_CONCAT)
NEG_PRECEDENCE, // unary -, ~
BANG_PRECEDENCE, // !, NOT (if HIGH_NOT_PRECEDENCE)
NEG_PRECEDENCE, // unary -, ~, !, NOT (if HIGH_NOT_PRECEDENCE)
COLLATE_PRECEDENCE, // BINARY, COLLATE
DEFAULT_PRECEDENCE,
HIGHEST_PRECEDENCE
......
......@@ -574,7 +574,7 @@ class Item_func_not :public Item_bool_func
longlong val_int();
enum Functype functype() const { return NOT_FUNC; }
const char *func_name() const { return "not"; }
enum precedence precedence() const { return BANG_PRECEDENCE; }
enum precedence precedence() const { return NEG_PRECEDENCE; }
Item *neg_transformer(THD *thd);
bool fix_fields(THD *, Item **);
virtual void print(String *str, enum_query_type query_type);
......
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