Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
477 changes: 477 additions & 0 deletions mysql-test/main/func_bitops_binary.result

Large diffs are not rendered by default.

396 changes: 396 additions & 0 deletions mysql-test/main/func_bitops_binary.test

Large diffs are not rendered by default.

70 changes: 0 additions & 70 deletions sql/item_cmpfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5062,76 +5062,6 @@ bool Item_func_in::ora_join_processor(void *arg)
return FALSE;
}


class Func_handler_bit_or_int_to_ulonglong:
public Item_handled_func::Handler_ulonglong
{
public:
Longlong_null to_longlong_null(Item_handled_func *item) const override
{
DBUG_ASSERT(item->fixed());
Longlong_null a= item->arguments()[0]->to_longlong_null();
return a.is_null() ? a : a | item->arguments()[1]->to_longlong_null();
}
};


class Func_handler_bit_or_dec_to_ulonglong:
public Item_handled_func::Handler_ulonglong
{
public:
Longlong_null to_longlong_null(Item_handled_func *item) const override
{
DBUG_ASSERT(item->fixed());
VDec a(item->arguments()[0]);
return a.is_null() ? Longlong_null() :
a.to_xlonglong_null() | VDec(item->arguments()[1]).to_xlonglong_null();
}
};


bool Item_func_bit_or::fix_length_and_dec(THD *thd)
{
static Func_handler_bit_or_int_to_ulonglong ha_int_to_ull;
static Func_handler_bit_or_dec_to_ulonglong ha_dec_to_ull;
return fix_length_and_dec_op2_std(&ha_int_to_ull, &ha_dec_to_ull);
}


class Func_handler_bit_and_int_to_ulonglong:
public Item_handled_func::Handler_ulonglong
{
public:
Longlong_null to_longlong_null(Item_handled_func *item) const override
{
DBUG_ASSERT(item->fixed());
Longlong_null a= item->arguments()[0]->to_longlong_null();
return a.is_null() ? a : a & item->arguments()[1]->to_longlong_null();
}
};


class Func_handler_bit_and_dec_to_ulonglong:
public Item_handled_func::Handler_ulonglong
{
public:
Longlong_null to_longlong_null(Item_handled_func *item) const override
{
DBUG_ASSERT(item->fixed());
VDec a(item->arguments()[0]);
return a.is_null() ? Longlong_null() :
a.to_xlonglong_null() & VDec(item->arguments()[1]).to_xlonglong_null();
}
};


bool Item_func_bit_and::fix_length_and_dec(THD *thd)
{
static Func_handler_bit_and_int_to_ulonglong ha_int_to_ull;
static Func_handler_bit_and_dec_to_ulonglong ha_dec_to_ull;
return fix_length_and_dec_op2_std(&ha_int_to_ull, &ha_dec_to_ull);
}

Item_cond::Item_cond(THD *thd, Item_cond *item)
:Item_bool_func(thd, item),
and_tables_cache(item->and_tables_cache)
Expand Down
Loading