Skip to content

Commit 13c55dc

Browse files
committed
fix 10.5 compatibility broken in MDEV-19940
varchar innodb information_schema columns that where effectively boolean got replaced by a int in MDEV-19940 in MariaDB-10.5.0. We use a MariaDB-10.2+ feature EXECUTE IMMEDIATE to form the VIEW expression correctly based on the version. Using EXECUTE IMMEDIATE we've effectively broken <=10.1 compatiblity which is now out of support from MariaDB upstream. closes FromDual#1
1 parent c000211 commit 13c55dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

views/p_s/metrics_56.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
-- +-----------------------------------------------+-------------------------...+--------------------------------------+---------+
7676
-- 565 rows in set, 1 warning (0.02 sec)
7777

78+
EXECUTE IMMEDIATE CONCAT("
7879
CREATE OR REPLACE
7980
ALGORITHM = TEMPTABLE
8081
DEFINER = 'root'@'localhost'
@@ -91,7 +92,9 @@ SELECT LOWER(VARIABLE_NAME) AS Variable_name, VARIABLE_VALUE AS Variable_value,
9192
) UNION ALL (
9293
SELECT NAME AS Variable_name, COUNT AS Variable_value,
9394
CONCAT('InnoDB Metrics - ', SUBSYSTEM) AS Type,
94-
IF(STATUS = 'enabled', 'YES', 'NO') AS Enabled
95+
IF(",
96+
IF(version() REGEXP '10\.[1-4].*',"STATUS = 'enabled'", "ENABLED"),
97+
", 'YES', 'NO') AS Enabled
9598
FROM information_schema.INNODB_METRICS
9699
-- Deduplication - some variables exists both in GLOBAL_STATUS and INNODB_METRICS
97100
-- Keep the one from GLOBAL_STATUS as it is always enabled and it's more likely to be used for existing tools.
@@ -109,4 +112,4 @@ SELECT 'NOW()' AS Variable_name, NOW(3) AS Variable_value, 'System Time' AS Type
109112
) UNION ALL (
110113
SELECT 'UNIX_TIMESTAMP()' AS Variable_name, ROUND(UNIX_TIMESTAMP(NOW(3)), 3) AS Variable_value, 'System Time' AS Type, 'YES' AS Enabled
111114
)
112-
ORDER BY Type, Variable_name;
115+
ORDER BY Type, Variable_name");

0 commit comments

Comments
 (0)