Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.14
-
None
Description
Current implementation of Item_cache::is_null() in MariaDB comes from http://bazaar.launchpad.net/~maria-captains/maria/10.0/revision/2502.313.1 which was fixing incorrect query results. MySQL 5.6 apparently had similar problems with incorrect query results, but they fixed Item_cache::is_null() slightly differently: http://bazaar.launchpad.net/~mysql/mysql-server/5.6/revision/3690.1.115. And it turns out that MySQL's implementation is correct while MariaDB's is not.
Unfortunately I don't know if it's possible to exhibit the problem using some SQL – the test from MySQL's patch passes on MariaDB. But the difference for us was in the custom storage engine inside the cond_push() function. Apparently by the time this function is called Item_cache doesn't have a cached value yet and thus is_null() always return true leading to incorrect behavior of the storage engine.
Please incorporate MySQL's implementation of Item_cache::is_null() and if possible add a test for this specific problem.