1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Replace ha_notify_table_changed() with notify_tabledef_changed()

Reason for the change was that ha_notify_table_changed() was done
after table open when .frm had been replaced, which caused failure
in engines that checks on open if .frm matches the engines table
definition.

Other changes:
- Remove not needed open/close call at end of inline alter table.
  Some test that depended on the table beeing in the table cache after
  ALTER TABLE had to be updated.
This commit is contained in:
Monty
2019-05-08 23:12:01 +03:00
parent 96037a6f03
commit 007f68c37f
17 changed files with 78 additions and 111 deletions

View File

@ -1642,6 +1642,14 @@ struct handlerton
int (*discover_table_structure)(handlerton *hton, THD* thd,
TABLE_SHARE *share, HA_CREATE_INFO *info);
/*
Notify the storage engine that the definition of the table (and the .frm
file) has changed. Returns 0 if ok.
*/
int (*notify_tabledef_changed)(handlerton *hton, LEX_CSTRING *db,
LEX_CSTRING *table_name, LEX_CUSTRING *frm,
LEX_CUSTRING *org_tabledef_version);
/*
System Versioning
*/
@ -4269,7 +4277,7 @@ public:
*) Update SQL-layer data-dictionary by installing .FRM file for the new version
of the table.
*) Inform the storage engine about this change by calling the
handler::ha_notify_table_changed() method.
hton::notify_table_changed()
*) Destroy the Alter_inplace_info and handler_ctx objects.
*/
@ -4336,16 +4344,6 @@ public:
bool commit);
/**
Public function wrapping the actual handler call.
@see notify_table_changed()
*/
void ha_notify_table_changed()
{
notify_table_changed();
}
protected:
/**
Allows the storage engine to update internal structures with concurrent
@ -4444,14 +4442,6 @@ protected:
return false;
}
/**
Notify the storage engine that the table structure (.FRM) has been updated.
@note No errors are allowed during notify_table_changed().
*/
virtual void notify_table_changed() { }
public:
/* End of On-line/in-place ALTER TABLE interface. */