Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit e60c8fc

Browse files
committed
Merge pull request #92 from JesperWisborgKrogh/dev/replication_20150825
Remove support for the pre-5.7.7 Performance Schema replication tables
2 parents f965014 + 7b5cacd commit e60c8fc

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

procedures/diagnostics.sql

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -288,17 +288,15 @@ BEGIN
288288
SET v_has_innodb = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = 'InnoDB'), 'NO'),
289289
v_has_ndb = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = 'NDBCluster'), 'NO'),
290290
v_has_ps = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = 'PERFORMANCE_SCHEMA'), 'NO'),
291-
v_has_ps_replication = IF(v_has_ps = 'YES',
292-
IF(EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'replication_applier_status'),
293-
'NEW',
294-
IF(EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'replication_execute_status'),
295-
'OLD',
296-
'NO')),
297-
'NO'),
298-
v_has_replication = IF(v_has_ps_replication <> 'NO', IF((SELECT COUNT(*) FROM performance_schema.replication_connection_status) > 0, 'YES', 'NO'),
291+
v_has_ps_replication = IF(v_has_ps = 'YES'
292+
AND EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'replication_applier_status'),
293+
'YES',
294+
'NO'
295+
),
296+
v_has_replication = /*!50707 IF(v_has_ps_replication = 'YES', IF((SELECT COUNT(*) FROM performance_schema.replication_connection_status) > 0, 'YES', 'NO'),*/
299297
IF(@@master_info_repository = 'TABLE', IF((SELECT COUNT(*) FROM mysql.slave_master_info) > 0, 'YES', 'NO'),
300298
IF(@@relay_log_info_repository = 'TABLE', IF((SELECT COUNT(*) FROM mysql.slave_relay_log_info) > 0, 'YES', 'NO'),
301-
'MAYBE'))),
299+
'MAYBE'))/*!50707 )*/,
302300
v_has_metrics = IF(v_has_ps = 'YES' OR (sys.version_major() = 5 AND sys.version_minor() = 6), 'YES', 'NO'),
303301
v_has_ps_vars = 'NO';
304302

@@ -555,17 +553,14 @@ BEGIN
555553
-- No guarantee that replication is actually configured, but we can't really know
556554
SELECT CONCAT('Replication Configured: ', v_has_replication, ' - Performance Schema Replication Tables: ', v_has_ps_replication) AS 'Replication Status';
557555

558-
IF (v_has_ps_replication <> 'NO') THEN
556+
IF (v_has_ps_replication = 'YES') THEN
559557
SELECT 'Replication - Connection Configuration' AS 'The following output is:';
560558
SELECT * FROM performance_schema.replication_connection_configuration/*!50706 ORDER BY CHANNEL_NAME*/;
561559
END IF;
562560

563-
IF (v_has_ps_replication = 'NEW') THEN
561+
IF (v_has_ps_replication = 'YES') THEN
564562
SELECT 'Replication - Applier Configuration' AS 'The following output is:';
565563
SELECT * FROM performance_schema.replication_applier_configuration ORDER BY CHANNEL_NAME;
566-
ELSEIF (v_has_ps_replication = 'OLD') THEN
567-
SELECT 'Replication - Execute Configuration' AS 'The following output is:';
568-
SELECT * FROM performance_schema.replication_execute_configuration;
569564
END IF;
570565

571566
IF (@@master_info_repository = 'TABLE') THEN
@@ -688,12 +683,10 @@ BEGIN
688683
SELECT 'SHOW SLAVE STATUS' AS 'The following output is:';
689684
SHOW SLAVE STATUS;
690685

691-
IF (v_has_ps_replication <> 'NO') THEN
686+
IF (v_has_ps_replication = 'YES') THEN
692687
SELECT 'Replication Connection Status' AS 'The following output is:';
693688
SELECT * FROM performance_schema.replication_connection_status;
694-
END IF;
695689

696-
IF (v_has_ps_replication = 'NEW') THEN
697690
SELECT 'Replication Applier Status' AS 'The following output is:';
698691
SELECT * FROM performance_schema.replication_applier_status ORDER BY CHANNEL_NAME;
699692

@@ -702,15 +695,6 @@ BEGIN
702695

703696
SELECT 'Replication Applier Status - Worker' AS 'The following output is:';
704697
SELECT * FROM performance_schema.replication_applier_status_by_worker ORDER BY CHANNEL_NAME, WORKER_ID;
705-
ELSEIF (v_has_ps_replication = 'NEW') THEN
706-
SELECT 'Replication Execute Status' AS 'The following output is:';
707-
SELECT * FROM performance_schema.replication_execute_status/*!50706 ORDER BY CHANNEL_NAME*/;
708-
709-
SELECT 'Replication Execute Status - Coordinator' AS 'The following output is:';
710-
SELECT * FROM performance_schema.replication_execute_status_by_coordinator/*!50706 ORDER BY CHANNEL_NAME*/;
711-
712-
SELECT 'Replication Execute Status - Worker' AS 'The following output is:';
713-
SELECT * FROM performance_schema.replication_execute_status_by_worker ORDER BY/*!50706 CHANNEL_NAME, */WORKER_ID;
714698
END IF;
715699

716700
IF (@@master_info_repository = 'TABLE') THEN

0 commit comments

Comments
 (0)