| Bug #108516 | Return value of my_b_flush_io_cache(IO_CACHE*, int) not get checked | ||
|---|---|---|---|
| Submitted: | 16 Sep 2022 1:50 | Modified: | 16 Sep 2022 5:58 |
| Reporter: | Li Zhong | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
| Version: | 8.0.21 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[16 Sep 2022 1:50]
Li Zhong
[16 Sep 2022 5:58]
MySQL Verification Team
Hello Li Zhong, Thank you for the report and feedback. regards, Umesh
[19 Sep 2022 13:24]
Tor Didriksen
Posted by developer:
my_b_flush_io_cache *does* return -1 on error
return (info->error = -1);
so the hash source code is OK.
In most other contexts we test for non-zero, with
if (flush_io_cache(&file) ...
so maybe your static analysis tool thinks this is a boolean true/false function.
Anyways, it seems better to test for non-zero, also in HashJoinChunk::Rewind()
