My Project
|
#include <sql_prepare.h>
Public Member Functions | |
bool | report_error (THD *thd) |
bool | is_invalidated () const |
void | reset_reprepare_observer () |
An interface that is used to take an action when the locking module notices that a table version has changed since the last execution. "Table" here may refer to any kind of table -- a base table, a temporary table, a view or an information schema table.
When we open and lock tables for execution of a prepared statement, we must verify that they did not change since statement prepare. If some table did change, the statement parse tree *may* be no longer valid, e.g. in case it contains optimizations that depend on table metadata.
This class provides an interface (a method) that is invoked when such a situation takes place. The implementation of the method simply reports an error, but the exact details depend on the nature of the SQL statement.
At most 1 instance of this class is active at a time, in which case THD::m_reprepare_observer is not NULL.
bool Reprepare_observer::report_error | ( | THD * | thd | ) |
Check if a change of metadata is OK. In future the signature of this method may be extended to accept the old and the new versions, but since currently the check is very simple, we only need the THD to report an error.
Push an error to the error stack and return TRUE for now.