| 1 |
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
| 2 |
# |
| 3 |
# This program is free software; you can redistribute it and/or modify |
| 4 |
# it under the terms of the GNU General Public License, version 2.0, |
| 5 |
# as published by the Free Software Foundation. |
| 6 |
# |
| 7 |
# This program is also distributed with certain software (including |
| 8 |
# but not limited to OpenSSL) that is licensed under separate terms, |
| 9 |
# as designated in a particular file or component or in included license |
| 10 |
# documentation. The authors of MySQL hereby grant you an additional |
| 11 |
# permission to link the program and your derivative works with the |
| 12 |
# separately licensed software that they have included with MySQL. |
| 13 |
# |
| 14 |
# This program is distributed in the hope that it will be useful, |
| 15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
# GNU General Public License, version 2.0, for more details. |
| 18 |
# |
| 19 |
# You should have received a copy of the GNU General Public License |
| 20 |
# along with this program; if not, write to the Free Software Foundation, |
| 21 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA |
| 22 |
|
| 23 |
# Tests for PERFORMANCE_SCHEMA |
| 24 |
|
| 25 |
--source include/not_embedded.inc |
| 26 |
--source include/have_perfschema.inc |
| 27 |
|
| 28 |
#--disable_result_log |
| 29 |
select * from performance_schema.events_statements_summary_by_digest |
| 30 |
where digest like 'XXYYZZ%' limit 1; |
| 31 |
|
| 32 |
select * from performance_schema.events_statements_summary_by_digest |
| 33 |
where digest='XXYYZZ'; |
| 34 |
#--enable_result_log |
| 35 |
|
| 36 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 37 |
insert into performance_schema.events_statements_summary_by_digest |
| 38 |
set digest='XXYYZZ', count_star=1, sum_timer_wait=2, min_timer_wait=3, |
| 39 |
avg_timer_wait=4, max_timer_wait=5; |
| 40 |
|
| 41 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 42 |
update performance_schema.events_statements_summary_by_digest |
| 43 |
set count_star=12; |
| 44 |
|
| 45 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 46 |
update performance_schema.events_statements_summary_by_digest |
| 47 |
set count_star=12 where digest like "XXYYZZ"; |
| 48 |
|
| 49 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 50 |
delete from performance_schema.events_statements_summary_by_digest |
| 51 |
where count_star=1; |
| 52 |
|
| 53 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 54 |
delete from performance_schema.events_statements_summary_by_digest; |
| 55 |
|
| 56 |
-- error ER_TABLEACCESS_DENIED_ERROR |
| 57 |
LOCK TABLES performance_schema.events_statements_summary_by_digest READ; |
| 58 |
UNLOCK TABLES; |
| 59 |
|
| 60 |
-- error ER_TABLEACCESS_DENIED_ERROR |
| 61 |
LOCK TABLES performance_schema.events_statements_summary_by_digest WRITE; |
| 62 |
UNLOCK TABLES; |
| 63 |
|
| 64 |
--echo # |
| 65 |
--echo # MDEV-25325 column_comment for performance_schema tables |
| 66 |
--echo # |
| 67 |
select column_name, column_comment |
| 68 |
from information_schema.columns |
| 69 |
where table_schema='performance_schema' and table_name='events_statements_summary_by_digest'; |