Bug #98572 xacommit_handlerton should check hton->commit_by_xid rather than hton->recover
Submitted: 12 Feb 2020 16:46 Modified: 13 Feb 2020 12:58
Reporter: dennis gao Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.25 OS:Any
Assigned to: CPU Architecture:Any

[12 Feb 2020 16:46] dennis gao
Description:
In static my_bool xacommit_handlerton, current mysql code check hton->recover rather than hton->commit_by_xid.

   │39      static my_bool xacommit_handlerton(THD *unused1, plugin_ref plugin,                                                                                                                            │
   │40                                         void *arg)                                                                                                                                                  │
   │41      {                                                                                                                                                                                              │
   │42        handlerton *hton= plugin_data<handlerton*>(plugin);                                                                                                                                          │
  >│43        if (hton->state == SHOW_OPTION_YES && hton->recover)                                                                                                                                         │
   │44          hton->commit_by_xid(hton, (XID *)arg);                                                                                                                                                     │
   │45                                                                                                                                                                                                     │
   │46        return FALSE;                                                                                                                                                                                │
   │47      } 

How to repeat:
Just check the code.

Suggested fix:
adjust hton->recover checking to hton->commit_by_xid checking in xacommit_handlerton.
[12 Feb 2020 16:50] dennis gao
also xarollback_handlerton
[13 Feb 2020 12:58] MySQL Verification Team
Hi Mr. gao,

Thank you for your bug report.

However, this is not a bug.

The reason is quite simple and that is that hton->recover has to be called when SHOW statement is used. Otherwise, only hton->commit_by_xid() is checked.

Not a bug.