[MDEV-8450] [PATCH] Wrong macro expansion in Query_cache::send_result_to_client() Created: 2015-07-10 Updated: 2015-09-06 Resolved: 2015-09-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0.20, 10.1.5 |
| Fix Version/s: | 10.0.22, 10.1.7 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Pavel Ivanov | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| 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. |
| Comments |
| Comment by Elena Stepanova [ 2015-07-12 ] |
|
sanja, please check it out. |
| Comment by Pavel Ivanov [ 2015-07-17 ] |
|
I've proposed a pull request to fix this: https://github.com/MariaDB/server/pull/87. |
| Comment by Oleksandr Byelkin [ 2015-09-01 ] |
|
I grepped and found more unprotected expression, most of them are harmless, but it is better get rid of bad examples. |
| Comment by Oleksandr Byelkin [ 2015-09-01 ] |
|
revision-id: 0a1b60a8aee4bce3235fd5a1d8cb2231b51ff5cc (mariadb-10.0.21-7-g0a1b60a)
Expression in macro protected by () |
| Comment by Sergey Vojtovich [ 2015-09-04 ] |
|
Ok to push. |