Bug #61979 | MySQL 5.5 and PVS-Studio | ||
---|---|---|---|
Submitted: | 26 Jul 2011 5:41 | Modified: | 26 Jul 2011 11:51 |
Reporter: | Andrey Karpov | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: General | Severity: | S3 (Non-critical) |
Version: | 5.5.16 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[26 Jul 2011 5:41]
Andrey Karpov
[26 Jul 2011 11:51]
Valeriy Kravchuk
Verified with current mysql-5.5 from bzr by code review. Indeed, at least some of the code fragments found look logically incorrect, like this one ("sql-common/my_time.c" line 340 of 1257): if (str[0] == 'p' || str[0] == 'P') add_hours= 12; else if (str[0] != 'a' || str[0] != 'A') continue; /* Not AM/PM */
[4 Oct 2016 7:10]
Laurynas Biveinis
I became curious how do the pointed out issues stand five years later and looked into them: 1. Issue fixed in 8.0 by commit 3c270a5f78e8625ad5110b72f7a578a035443f5c Author: Jon Olav Hauglid <jon.hauglid@oracle.com> Date: Wed May 4 09:31:26 2016 +0200 Bug#23195845: FIX COMPILE WARNINGS REPORTED BY GCC 6.1 Fix compile warnings reported by recently released GCC 6.1: -Werror=misleading-indentation libbinlogevents/src/uuid.cpp rapid/plugin/x/mysqlxtest_src/mysqlx.cc sql/sql_update.cc This error had to be disabled for files using Boost. -Werror=nonnull-compare storage/innobase/include/dict0dict.ic -Werror=logical-op mysys/mf_dirname.cc sql/item_timefunc.cc sql/mysqld.cc vio/viosocket.cc Also fix problem in mysys/my_sync.cc where we were using __linux rather than the correct __linux__ symbol. 2. The code is still the same 3. Issue fixed in 8.0 by commit eff9bbedd4ccb20eff352f3b3ea8f7f2319e909a Author: Jon Olav Hauglid <jon.hauglid@oracle.com> Date: Mon Jun 29 08:28:01 2015 +0100 Bug#21285604: ENABLE -WMISSING-FORMAT-ATTRIBUTE AND -WLOGICAL-OP WARNINGS This patch adds -Wmissing-format-attribute and -Wlogical-op to the list of warnings reported by GCC. The patch also fixes a number of code issues/bugs that were revealed by these warnings. The mistaken use of || rather than && in a few boolean expressions and wrong number/type of arguments to printf-style functions. The patch also removes some redundant declarations found with -Wredundant-decls 4. The code is still the same 5. Issue fixed in 5.6 by commit c028d88f46a301edeb2b56bd2eefad311af705a5 Author: kevin.lewis@oracle.com <> Date: Wed Jun 6 11:29:11 2012 -0500 Bug#13809713-SUSPICIOUS CHECK IN HA_INNOBASE::CREATE() Approved by Marco on IM 6. The code is still the same 7. Issue fixed in 5.5 by commit 0a8ae683297e494703c50d362e211d3ed1f3f5c3 Author: Tor Didriksen <tor.didriksen@oracle.com> Date: Tue Jun 5 15:53:39 2012 +0200 Bug#14051002 VALGRIND: CONDITIONAL JUMP OR MOVE IN RR_CMP / MY_QSORT Patch for 5.1 and 5.5: fix typo in byte comparison in rr_cmp(). To sum up, out of 7 original bugs, one has been fixed in 5.5+, one in 5.6+, two in 8.0, and three still stand.