Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6910

Item_cache::is_null() returns incorrect result inside storage engine's cond_push()

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.0.14
    • Fix Version/s: 10.0
    • Component/s: None
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            danblack Daniel Black added a comment -
            Show
            danblack Daniel Black added a comment - seems to still be the case https://github.com/MariaDB/server/blob/10.0/sql/item.h#L4560

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                pivanof Pavel Ivanov
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: