My Project
Public Member Functions
Item_func_xor Class Reference

#include <item_cmpfunc.h>

Inheritance diagram for Item_func_xor:
Item_bool_func2 Item_bool_func Item_int_func Item_func Item_result_field Item

List of all members.

Public Member Functions

 Item_func_xor (Item *i1, Item *i2)
enum Functype functype () const
const char * func_name () const
longlong val_int ()
void top_level_item ()
Itemneg_transformer (THD *thd)

Detailed Description

XOR inherits from Item_bool_func2 because it is not optimized yet. Later, when XOR is optimized, it needs to inherit from Item_cond instead. See WL#5800.


Member Function Documentation

Item * Item_func_xor::neg_transformer ( THD *  thd) [virtual]

XOR can be negated by negating one of the operands:

NOT (a XOR b) => (NOT a) XOR b => a XOR (NOT b)

Parameters:
thdThread handle
Returns:
New negated item

Reimplemented from Item.

longlong Item_func_xor::val_int ( void  ) [virtual]

Make a logical XOR of the arguments.

If either operator is NULL, return NULL.

Todo:
(low priority) Change this to be optimized as:
A XOR B -> (A) == 1 AND (B) <> 1) OR (A <> 1 AND (B) == 1)
To be able to do this, we would however first have to extend the MySQL range optimizer to handle OR better.
Note:
As we don't do any index optimization on XOR this is not going to be very fast to use.

Implements Item.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines