static inline int part_val_int(Item *item_expr, longlong *result)
{
  switch (item_expr->cmp_type())
  {
  case DECIMAL_RESULT:
  {
    my_decimal buf;
    my_decimal *val= item_expr->val_decimal(&buf);
    if (val && my_decimal2int(E_DEC_FATAL_ERROR, val, item_expr->unsigned_flag,
                              result, FLOOR) != E_DEC_OK)
      return true;
    break;
  }
  case INT_RESULT:
    *result= item_expr->val_int();
    break;
  case STRING_RESULT:
  case REAL_RESULT:
  case ROW_RESULT:
  case TIME_RESULT:
    DBUG_ASSERT(0);
    break;
  }
  if (item_expr->null_value)
  {
    if (unlikely(current_thd->is_error()))
      return true;
    *result= LONGLONG_MIN;
  }
  return false;
}
static inline int part_val_int(Item *item_expr, longlong *result)
{
  switch (item_expr->cmp_type())
  {
  case DECIMAL_RESULT:
  {
    my_decimal buf;
    my_decimal *val= item_expr->val_decimal(&buf);
    if (val && my_decimal2int(E_DEC_FATAL_ERROR, val, item_expr->unsigned_flag,
                              result, FLOOR) != E_DEC_OK)
      return true;
    break;
  }
  case INT_RESULT:
    *result= item_expr->val_int();
    break;
  case STRING_RESULT:
  case REAL_RESULT:
  case ROW_RESULT:
  case TIME_RESULT:
    DBUG_ASSERT(0);
    break;
  }
  if (item_expr->null_value)
  {
    if (unlikely(current_thd->is_error()))
      return true;
    *result= LONGLONG_MIN;
  }
  return false;
}