mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#27430 "Crash in subquery code when in PS and table DDL changed after
PREPARE": rename members, methods, classes to follow the spec (a code review request)
This commit is contained in:
@ -24,7 +24,7 @@
|
||||
#include "rpl_tblmap.h"
|
||||
|
||||
/**
|
||||
An abstract interface that can be used to take an action when
|
||||
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
|
||||
@ -36,36 +36,35 @@
|
||||
parse tree *may* be no longer valid, e.g. in case it contains
|
||||
optimizations that depend on table metadata.
|
||||
|
||||
This class provides an abstract interface (a method) that is
|
||||
This class provides an interface (a method) that is
|
||||
invoked when such a situation takes place.
|
||||
The implementation of the interface in most cases simply
|
||||
reports an error, but the exact details depend on the nature of
|
||||
the SQL statement.
|
||||
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_metadata_observer is not NULL.
|
||||
case THD::m_reprepare_observer is not NULL.
|
||||
|
||||
@sa check_and_update_table_version() for details of the
|
||||
version tracking algorithm
|
||||
|
||||
@sa Execute_observer for details of how we detect that
|
||||
a metadata change is fatal and a re-prepare is necessary
|
||||
|
||||
@sa Open_tables_state::m_metadata_observer for the life cycle
|
||||
@sa Open_tables_state::m_reprepare_observer for the life cycle
|
||||
of metadata observers.
|
||||
*/
|
||||
|
||||
class Metadata_version_observer
|
||||
class Reprepare_observer
|
||||
{
|
||||
public:
|
||||
virtual ~Metadata_version_observer();
|
||||
/**
|
||||
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.
|
||||
*/
|
||||
virtual bool report_error(THD *thd)= 0;
|
||||
bool report_error(THD *thd);
|
||||
bool is_invalidated() const { return m_invalidated; }
|
||||
void reset_reprepare_observer() { m_invalidated= FALSE; }
|
||||
private:
|
||||
bool m_invalidated;
|
||||
};
|
||||
|
||||
|
||||
@ -848,7 +847,7 @@ public:
|
||||
tracking.
|
||||
@sa check_and_update_table_version()
|
||||
*/
|
||||
Metadata_version_observer *m_metadata_observer;
|
||||
Reprepare_observer *m_reprepare_observer;
|
||||
|
||||
/**
|
||||
List of regular tables in use by this thread. Contains temporary and
|
||||
@ -953,7 +952,7 @@ public:
|
||||
extra_lock= lock= locked_tables= 0;
|
||||
prelocked_mode= NON_PRELOCKED;
|
||||
state_flags= 0U;
|
||||
m_metadata_observer= NULL;
|
||||
m_reprepare_observer= NULL;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user