[MDEV-26504] THD::copy_db_to() fails to return error if THD::db is null Created: 2021-08-30 Updated: 2021-08-30 Resolved: 2021-08-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Embedded Server |
| Affects Version/s: | 10.2.17 |
| Fix Version/s: | 10.2.41 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | not-10.3, not-10.4, not-10.5, not-10.6, not-10.7, regression-10.2 | ||
| Issue Links: |
|
||||||||
| Description |
|
GCC 11.2.0 reported the following warning for CMAKE_BUILD_TYPE=RelWithDebInfo:
The reason for this is that THD::copy_db_to() may return false even when it is not assigning db:
The following fixes that:
It is unclear whether this bug has any impact on 10.2, because the invocation that GCC 11 complained about is in the handling of COM_FIELD_LIST, which is almost dead code. As far as I can tell, that code is only used in the embedded server implementation of mysql_list_fields(). In 10.3 and later, the function THD::copy_db_to() already returned true in this case. |