1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-07 06:01:31 +03:00
Files
mariadb/mysql-test/suite/perfschema/t/misc.test
Marc Alff 4372875aa1 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.
2010-12-01 13:06:41 +01:00

86 lines
2.4 KiB
Plaintext

# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
# Miscelaneous
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Bug#45496 Performance schema: assertion fails in
# ha_perfschema::rnd_init:223
#
--disable_result_log
SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE THREAD_ID IN
(SELECT THREAD_ID FROM performance_schema.threads)
AND EVENT_NAME IN
(SELECT NAME FROM performance_schema.setup_instruments
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
--enable_result_log
#
# Bug#45088 Should not be able to create tables of engine PERFORMANCE_SCHEMA
#
--error ER_CANT_CREATE_TABLE
create table test.t1(a int) engine=performance_schema;
#
# Bug#44897 Performance Schema: can create a ghost table in another database
#
--error ER_CANT_CREATE_TABLE
create table test.t1 like performance_schema.events_waits_current;
#
# Bug#44898 PerformanceSchema: can create a table in db performance_schema, cannot insert
#
--error ER_TABLEACCESS_DENIED_ERROR
create table performance_schema.t1(a int);
#
# Bug#51447 performance schema evil twin files
#
--disable_warnings
drop table if exists test.ghost;
--enable_warnings
create table test.ghost (a int, b int);
alter table test.ghost add index index_a(a);
alter table test.ghost add index index_b(b);
insert into test.ghost values (1, 3);
insert into test.ghost values (2, 4);
select * from test.ghost;
drop table test.ghost;
# Shoud return nothing
select * from performance_schema.file_instances
where file_name like "%ghost%";
#
# Bug#52586 Misleading error message on attempt to access
# a P_S table using a wrong name
--error ER_NO_SUCH_TABLE
select * from performance_schema.no_such_table;