Commit 0f314c9d authored by unknown's avatar unknown

make it clear for optimizer that XOR's are not optimizable at the moment (BUG#992)

parent 96456951
......@@ -46,6 +46,11 @@ select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
0 1 1 0 NULL NULL NULL
create table t1 (a int);
insert t1 values (1);
select * from t1 where 1 xor 1;
a
drop table t1;
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
0 1
......
......@@ -18,6 +18,11 @@ select -1.49 or -1.49,0.6 or 0.6;
select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
create table t1 (a int);
insert t1 values (1);
select * from t1 where 1 xor 1;
drop table t1;
#
# Wrong usage of functions
#
......
......@@ -28,7 +28,7 @@ class Item_bool_func :public Item_int_func
Item_bool_func(Item *a) :Item_int_func(a) {}
Item_bool_func(Item *a,Item *b) :Item_int_func(a,b) {}
void fix_length_and_dec() { decimals=0; max_length=1; }
unsigned int size_of() { return sizeof(*this);}
unsigned int size_of() { return sizeof(*this);}
};
class Item_bool_func2 :public Item_int_func
......@@ -595,7 +595,7 @@ class Item_cond :public Item_bool_func
void print(String *str);
void split_sum_func(List<Item> &fields);
friend int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds);
unsigned int size_of() { return sizeof(*this);}
unsigned int size_of() { return sizeof(*this);}
void top_level_item() { abort_on_null=1; }
};
......@@ -634,12 +634,18 @@ inline Item *and_conds(Item *a,Item *b)
return cond;
}
/*
XOR is Item_cond, not an Item_int_func bevause we could like to
optimize (a XOR b) later on. It's low prio, though
*/
class Item_cond_xor :public Item_cond
{
public:
Item_cond_xor() :Item_cond() {}
Item_cond_xor(Item *i1,Item *i2) :Item_cond(i1,i2) {}
enum Functype functype() const { return COND_XOR_FUNC; }
/* TODO: remove the next line when implementing XOR optimization */
enum Type type() const { return FUNC_ITEM; }
longlong val_int();
const char *func_name() const { return "xor"; }
};
......
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