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

MDEV-28344:sys.ps_setup_save and dependent procedures fail with ER_ILLEGAL_HA_CREATE_OPTION

- The problem:
==============
- Commit f7216fa63d created the check function for
  default temporary storage engine and in case the SE doesn't support temporary tables
  the error `ER_ILLEGAL_HA_CREATE_OPTION` is raised.
  Before that commit in such cases temporary tables were created by silently substituting
  default SE (RocksDB, Connect, PerfSchema) with MyISAM.
- The test `pr_diagnostics.test` was modified in that commit with raising the error,
  since I didn't check the root cause of test itself.

- The solution:
===============
- This commit update the root case: procedure `ps_setup_save()` that uses temporary
  tables created from performance schema tables definition using `LIKE`, what is not supported.
  The suggested fix is to use InnoDB table by using `AS SELECT`.
- Note that test `pr_diagnostics` will raise this error for `medium/full` third argument,
  but not for `current` value of third argument.
- Additionally this patch updates the test case of commit f7216fa, by adding missing relation
  between temporary tables and Performance schema in `perfschema.misc` test.

- Reviewed by: <wlad@mariadb.com>
This commit is contained in:
anel
2022-04-22 07:23:07 -07:00
parent 638afc4acf
commit 56fd0d7b06
5 changed files with 38 additions and 7 deletions

View File

@ -80,14 +80,11 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp_setup_instruments;
DROP TEMPORARY TABLE IF EXISTS tmp_threads;
CREATE TEMPORARY TABLE tmp_setup_actors LIKE performance_schema.setup_actors;
CREATE TEMPORARY TABLE tmp_setup_consumers LIKE performance_schema.setup_consumers;
CREATE TEMPORARY TABLE tmp_setup_instruments LIKE performance_schema.setup_instruments;
CREATE TEMPORARY TABLE tmp_setup_actors AS SELECT * FROM performance_schema.setup_actors;
CREATE TEMPORARY TABLE tmp_setup_consumers AS SELECT * FROM performance_schema.setup_consumers;
CREATE TEMPORARY TABLE tmp_setup_instruments AS SELECT * FROM performance_schema.setup_instruments;
CREATE TEMPORARY TABLE tmp_threads (THREAD_ID bigint unsigned NOT NULL PRIMARY KEY, INSTRUMENTED enum('YES','NO') NOT NULL);
INSERT INTO tmp_setup_actors SELECT * FROM performance_schema.setup_actors;
INSERT INTO tmp_setup_consumers SELECT * FROM performance_schema.setup_consumers;
INSERT INTO tmp_setup_instruments SELECT * FROM performance_schema.setup_instruments;
INSERT INTO tmp_threads SELECT THREAD_ID, INSTRUMENTED FROM performance_schema.threads;
ELSE
SIGNAL SQLSTATE VALUE '90000'