[MDEV-15736] mariadb-10.2.14/client/mysqladmin.cc:1586]: (style) Suspicious condition Created: 2018-03-29 Updated: 2023-07-12 Resolved: 2023-07-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3 |
| Fix Version/s: | 11.2.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | David Binderman | Assignee: | Andrew Hutchings |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Papercut | ||
| Description |
|
[mariadb-10.2.14/client/mysqladmin.cc:1586]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. Source code is
Maybe better code
UPDATE |
| Comments |
| Comment by Elena Stepanova [ 2018-10-04 ] |
|
The old code is still there, so I'm switching it to Confirmed just to move things forward. I leave it to whoever ends up fixing it to decide whether the new code is actually better. |
| Comment by Chris Calender (Inactive) [ 2019-02-08 ] |
|
I agree this is better. I added the fix here: https://github.com/MariaDB/server/pull/1168 C Operator Precedence rules listed here: https://en.cppreference.com/w/c/language/operator_precedence |
| Comment by Sergey Vojtovich [ 2019-03-22 ] |
|
Not really beginner-friendly as the fix impact verification is complicated by completely broken feature. |
| Comment by Anel Husakovic [ 2023-02-08 ] |
|
After debuggin, noticed that when using mysqladmin -E extended-status, function mysql_fetch_row() returns null and function print_relative_row_vert never gets called. |
| Comment by Andrew Hutchings [ 2023-02-15 ] |
|
Looking at the source code and the source of historic MariaDB and MySQL versions up to present, this function I don't think ever worked as intended or documented. It is difficult to even figure out what the original intention was supposed to look like. I have asked Monty for feedback as to what direction should be taken. |
| Comment by Andrew Hutchings [ 2023-03-07 ] |
|
Created a PR that kills this feature |