1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Bug#53696 Performance schema engine violates the PSEA API by calling my_error()

This is a code cleanup.

The implementation of a storage engine (subclasses of handler) is not supposed
to call my_error() directly inside the engine implementation, 
but only return error codes, and report errors later at the demand
of the sql layer only (if needed), using handler::print_error().

This fix removes misplaced calls to my_error(),
and provide an implementation of print_error() instead.

Given that the sql layer implementation of create table, ha_create_table(),
does not use print_error() but returns ER_CANT_CREATE_TABLE directly,
the return code for create table statements using the performance schema
has changed to ER_CANT_CREATE_TABLE.

Adjusted the test suite accordingly.
This commit is contained in:
Marc Alff
2010-12-01 13:06:41 +01:00
parent 45e17739d4
commit 4372875aa1
10 changed files with 57 additions and 39 deletions

View File

@@ -232,8 +232,6 @@ int PFS_engine_table::read_row(TABLE *table,
*/
if (! m_share_ptr->m_checked)
{
my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0),
PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name.str);
return HA_ERR_TABLE_NEEDS_UPGRADE;
}
@@ -279,8 +277,6 @@ int PFS_engine_table::update_row(TABLE *table,
*/
if (! m_share_ptr->m_checked)
{
my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0),
PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name.str);
return HA_ERR_TABLE_NEEDS_UPGRADE;
}
@@ -351,7 +347,6 @@ int PFS_engine_table::update_row_values(TABLE *,
unsigned char *,
Field **)
{
my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
return HA_ERR_WRONG_COMMAND;
}