Merge pull request #1350 from cmyker/master
Support of MariaDB 10+ multi-master replication functionality See https:...
This commit is contained in:
commit
f2e6c24370
@ -15,6 +15,19 @@ if (! defined('PHPMYADMIN')) {
|
||||
*/
|
||||
$server_master_replication = $GLOBALS['dbi']->fetchResult('SHOW MASTER STATUS');
|
||||
|
||||
/**
|
||||
* check for multi-master replication functionality
|
||||
*/
|
||||
$server_slave_multi_replication = $GLOBALS['dbi']->fetchResult('SHOW ALL SLAVES STATUS');
|
||||
|
||||
/**
|
||||
* set slave selected server
|
||||
*/
|
||||
if ($server_slave_multi_replication && $_REQUEST['master_connection']) {
|
||||
$GLOBALS['dbi']->query("SET @@default_master_connection = '" . PMA_Util::sqlAddSlashes($_REQUEST['master_connection']) . "'");
|
||||
$GLOBALS['url_params']['master_connection'] = $_REQUEST['master_connection'];
|
||||
}
|
||||
|
||||
/**
|
||||
* get slave replication from server
|
||||
*/
|
||||
|
||||
@ -139,6 +139,21 @@ function PMA_getHtmlForSlaveConfiguration(
|
||||
) {
|
||||
$html = '<fieldset>';
|
||||
$html .= '<legend>' . __('Slave replication') . '</legend>';
|
||||
if ($GLOBALS['server_slave_multi_replication']) {
|
||||
$html .= __('Master connection:');
|
||||
$html .= '<form method="get" action="server_replication.php">';
|
||||
$html .= PMA_URL_getHiddenInputs($url_params);
|
||||
$html .= ' <select name="master_connection">';
|
||||
$html .= '<option value="">' . __('Default') . '</option>';
|
||||
foreach ($GLOBALS['server_slave_multi_replication'] as $server) {
|
||||
$html .= '<option' . ($server['Connection_name'] == $_REQUEST['master_connection'] ? ' selected="selected"' : '') . '>' .
|
||||
$server['Connection_name'] . '</option>';
|
||||
}
|
||||
$html .= '</select>';
|
||||
$html .= ' <input type="submit" value="' . __('Go') . '" id="goButton" />';
|
||||
$html .= '</form>';
|
||||
$html .= '<br /><br />';
|
||||
}
|
||||
if ($server_slave_status) {
|
||||
$html .= '<div id="slave_configuration_gui">';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user