Simple query with IF expression causes an assertion abort

Bug #998321 reported by Igor Babaev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Critical
Oleksandr "Sanja" Byelkin

Bug Description

The following simple query causes an assertion abort in MariaDB 5.1/5.2:

SELECT if(1, (SELECT min('hello')), NULL);

(see also bug#12620084 for mysql code line)

Changed in maria:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Oleksandr "Sanja" Byelkin (sanja-byelkin)
milestone: none → 5.1
Changed in maria:
status: Confirmed → In Progress
Revision history for this message
Oleksandr "Sanja" Byelkin (sanja-byelkin) wrote :

Problem is that cached_field_type of Item_func_if appeared to be MYSQL_TYPE_NULL...

Revision history for this message
Oleksandr "Sanja" Byelkin (sanja-byelkin) wrote :

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.

Changed in maria:
status: In Progress → Fix Committed
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.