Closed laurynas-biveinis closed 1 year ago
@luqun, this is required for MyRocks DDSE
@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
beside refactor, the main change is to add thd_sqlcom_can_generate_row_events(). LGTM.
Committed the PR
…ate events
Currently, the SQL command type is not checked when making the decision to forbid statement and mixed binlog formats, but some SQL commands may not generate row events anyway, thus it does not make sense to forbid them. Add this condition by calling thd_sqlcom_can_generate_row_events(thd). InnoDB has been using a similar check already.
The difference may not be substantial at the moment, but with MyRocks DDSE many SQL commands start satisfying this condition.
At the same time partially reorganize ha_rocksdb::external_lock code so that things are not checked if they are not needed (i.e. binlog format only needs to be read for F_WRLCK lock type), and do early error exit checks before performing actions such as creating the transaction object.