[MDEV-2364] LP:998321 - Simple query with IF expression causes an assertion abort Created: 2012-05-12  Updated: 2015-02-02  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Igor Babaev Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug998321.xml    

 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)



 Comments   
Comment by Oleksandr Byelkin [ 2012-05-14 ]

Re: Simple query with IF expression causes an assertion abort
Problem is that cached_field_type of Item_func_if appeared to be MYSQL_TYPE_NULL...

Comment by Oleksandr Byelkin [ 2012-05-14 ]

Re: Simple query with IF expression causes an assertion abort
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.

Comment by Rasmus Johansson (Inactive) [ 2012-05-17 ]

Launchpad bug id: 998321

Generated at Thu Feb 08 06:41:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.