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

[PATCH] Wrong macro expansion in Query_cache::send_result_to_client()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.0.20, 10.1.5
    • Fix Version/s: 10.0.22, 10.1.7
    • Component/s: OTHER
    • Labels:
      None

      Description

      Query_cache::send_result_to_client() has a statement here https://github.com/MariaDB/server/blob/10.1/sql/sql_cache.cc#L2141 that looks like the following:

      thd->query_plan_flags= (thd->query_plan_flags & ~QPLAN_QC_NO) | QPLAN_QC;

      Given that QPLAN_QC_NO is defined as 1 << 6 (without parenthesis) in https://github.com/MariaDB/server/blob/10.1/sql/log_slow.h, the expression expands into something that is apparently not wanted.

      All macro definitions in sql/log_slow.h should be put in parenthesis.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Oleksandr Byelkin, please check it out.

            Show
            elenst Elena Stepanova added a comment - Oleksandr Byelkin , please check it out.
            Hide
            pivanof Pavel Ivanov added a comment -

            I've proposed a pull request to fix this: https://github.com/MariaDB/server/pull/87.

            Show
            pivanof Pavel Ivanov added a comment - I've proposed a pull request to fix this: https://github.com/MariaDB/server/pull/87 .
            Hide
            sanja Oleksandr Byelkin added a comment -

            I grepped and found more unprotected expression, most of them are harmless, but it is better get rid of bad examples.

            Show
            sanja Oleksandr Byelkin added a comment - I grepped and found more unprotected expression, most of them are harmless, but it is better get rid of bad examples.
            Hide
            sanja Oleksandr Byelkin added a comment -

            revision-id: 0a1b60a8aee4bce3235fd5a1d8cb2231b51ff5cc (mariadb-10.0.21-7-g0a1b60a)
            parent(s): 4b41e3c7f33714186c97a6cc2e6d3bb93b050c61
            committer: Oleksandr Byelkin
            timestamp: 2015-09-01 11:47:06 +0200
            message:

            MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client()

            Expression in macro protected by ()

            Show
            sanja Oleksandr Byelkin added a comment - revision-id: 0a1b60a8aee4bce3235fd5a1d8cb2231b51ff5cc (mariadb-10.0.21-7-g0a1b60a) parent(s): 4b41e3c7f33714186c97a6cc2e6d3bb93b050c61 committer: Oleksandr Byelkin timestamp: 2015-09-01 11:47:06 +0200 message: MDEV-8450 : PATCH] Wrong macro expansion in Query_cache::send_result_to_client() Expression in macro protected by ()
            Hide
            svoj Sergey Vojtovich added a comment -

            Ok to push.

            Show
            svoj Sergey Vojtovich added a comment - Ok to push.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: