Comment 2 for bug 998321

Above caused by subselect reporting that it is constant and null_value is set in the tests:

  bool null1=args[1]->const_item() && args[1]->null_value;
  bool null2=args[2]->const_item() && args[2]->null_value;

IMHO above tests are not correct: they should chec basic_constant_item or call is_null_value() method to really evaluate the item.