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) sql/mysql_priv.h: enum_metadata_type -> enum_table_ref_type sql/sp_head.cc: Metadata_version_observer -> Reprepare_observer sql/sql_base.cc: metadata -> table_ref sql/sql_class.cc: Replace an abstract interface with a concrete implementation. sql/sql_class.h: enum_metadata_type -> enum_table_ref_type sql/sql_prepare.cc: Move implementation of Execute_observer to sql_class.cc and rename the class to Reprepare_observer. Use getters instead of direct access to the members. sql/table.h: metadata -> table_ref
This commit is contained in:
@ -3737,8 +3737,8 @@ void assign_new_table_id(TABLE_SHARE *share)
|
||||
|
||||
@sa Execute_observer
|
||||
@sa check_prepared_statement() to see cases when an observer is installed
|
||||
@sa TABLE_LIST::is_metadata_id_equal()
|
||||
@sa TABLE_SHARE::get_metadata_id()
|
||||
@sa TABLE_LIST::is_table_ref_id_equal()
|
||||
@sa TABLE_SHARE::get_table_ref_id()
|
||||
|
||||
@param[in] thd used to report errors
|
||||
@param[in,out] tables TABLE_LIST instance created by the parser
|
||||
@ -3754,10 +3754,10 @@ bool
|
||||
check_and_update_table_version(THD *thd,
|
||||
TABLE_LIST *tables, TABLE_SHARE *table_share)
|
||||
{
|
||||
if (! tables->is_metadata_id_equal(table_share))
|
||||
if (! tables->is_table_ref_id_equal(table_share))
|
||||
{
|
||||
if (thd->m_metadata_observer &&
|
||||
thd->m_metadata_observer->report_error(thd))
|
||||
if (thd->m_reprepare_observer &&
|
||||
thd->m_reprepare_observer->report_error(thd))
|
||||
{
|
||||
/*
|
||||
Version of the table share is different from the
|
||||
@ -3768,14 +3768,14 @@ check_and_update_table_version(THD *thd,
|
||||
return TRUE;
|
||||
}
|
||||
/* Always maintain the latest version and type */
|
||||
tables->set_metadata_id(table_share);
|
||||
tables->set_table_ref_id(table_share);
|
||||
}
|
||||
#if 0
|
||||
#ifndef DBUG_OFF
|
||||
/* Spuriously reprepare each statement. */
|
||||
if (thd->m_metadata_observer && thd->stmt_arena->is_reprepared == FALSE)
|
||||
if (thd->m_reprepare_observer && thd->stmt_arena->is_reprepared == FALSE)
|
||||
{
|
||||
thd->m_metadata_observer->report_error(thd);
|
||||
thd->m_reprepare_observer->report_error(thd);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
@ -3865,7 +3865,7 @@ retry:
|
||||
Note, the assert below is known to fail inside stored
|
||||
procedures (Bug#27011).
|
||||
*/
|
||||
DBUG_ASSERT(thd->m_metadata_observer);
|
||||
DBUG_ASSERT(thd->m_reprepare_observer);
|
||||
check_and_update_table_version(thd, table_list, share);
|
||||
/* Always an error. */
|
||||
DBUG_ASSERT(thd->is_error());
|
||||
|
Reference in New Issue
Block a user