Bug #109450 lock_hton_log and unlock_hton_log return values ignored
Submitted: 21 Dec 2022 9:59 Modified: 21 Dec 2022 13:10
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Storage Engine API Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[21 Dec 2022 9:59] Laurynas Biveinis
Description:
Two out of three handlerton interface methods needed for performance_schema.log_status support are lock_hton_log and unlock_hton_log. They both return bool, presumably to indicate error. But the callers in sql/log_resource.cc ignore that return value and assumes success. InnoDB always returns false for success, but i.e. MyRocks can return success or error.

The callers are Log_resource_hton_wrapper::lock and unlock methods.

The third method, collect_hton_log_info, has its return value checked.

(not sure if this is the right category, please adjust as needed)

How to repeat:
Read source code

Suggested fix:
Make Log_resource::lock and unlock virtual methods return bool, together with all their overrides.
Check that in table_log_status::make_row
[21 Dec 2022 13:10] MySQL Verification Team
Hi Mr. Biveinis,

Thank you for your bug report.

We have analysed the source code of the interface and we agree with you.

Verified as reported.