MDEV-25973: fixed the test plugins.test_sql_service
Set the data member THD::m_prepare_observer temporary to nullptr to avoid running a handler when a table version in TABLE_LIST differs from a value of version in TABLE_SHARE. It happens for any table when the method Ed_connection::execute_direct() is called from execute_sql_command() since the data members TABLE_LIST::m_table_ref_type and TABLES_LIST::m_table_ref_version have zero values on opening a table but corresponding members of TABLE_SHARE doesn't have. If the function execute_sql_command() is called on handling a Prepared statement it results in issuing the error ER_NEED_REPREPARE that is not issued in case the statement is run in regular way. So, to make fix the issue reset the data member THD::m_prepare_observer before running Ed_connection::execute_direct() and restoring it on return.
Showing
Please register or sign in to comment