1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge from 5.2

This commit is contained in:
unknown
2011-07-21 15:50:25 +03:00
22 changed files with 100 additions and 224 deletions

View File

@ -6794,6 +6794,28 @@ push_new_name_resolution_context(THD *thd,
}
/**
Fix condition which contains only field (f turns to f <> 0 )
@param cond The condition to fix
@return fixed condition
*/
Item *normalize_cond(Item *cond)
{
if (cond)
{
Item::Type type= cond->type();
if (type == Item::FIELD_ITEM || type == Item::REF_ITEM)
{
cond= new Item_func_ne(cond, new Item_int(0));
}
}
return cond;
}
/**
Add an ON condition to the second operand of a JOIN ... ON.
@ -6812,6 +6834,7 @@ void add_join_on(TABLE_LIST *b, Item *expr)
{
if (expr)
{
expr= normalize_cond(expr);
if (!b->on_expr)
b->on_expr= expr;
else