Merge branch 'QA_4_7'

This commit is contained in:
Michal Čihař 2017-05-09 15:05:06 +02:00
commit 6b45f57e45
3 changed files with 40 additions and 2 deletions

View File

@ -32,6 +32,7 @@ phpMyAdmin - ChangeLog
- issue #13234 Properly report not working sessions
- issue #13256 Fixed password check on server replication
- issue #13252 Fixed grid editing time column
- issue #13258 Fixed detection of Amazon RDS
4.7.0 (2017-03-28)
- patch #12233 [Display] Improve message when renaming database to same name

View File

@ -2767,8 +2767,8 @@ class DatabaseInterface
return Util::cacheGet('is_amazon_rds');
}
$sql = 'SELECT @@basedir';
$result = $this->fetchResult($sql);
$rds = ($result[0] == '/rdsdbbin/mysql/');
$result = $this->fetchValue($sql);
$rds = (substr($result, 0, 10) == '/rdsdbbin/');
Util::cacheSet('is_amazon_rds', $rds);
return $rds;

View File

@ -376,6 +376,43 @@ class DatabaseInterfaceTest extends PMATestCase
);
}
/**
* Tests for DBI::isAmazonRds() method.
*
* @return void
* @test
* @dataProvider isAmazonRdsData
*/
public function atestIsAmazonRdsData($value, $expected)
{
Util::cacheUnset('is_amazon_rds');
$extension = new PMA\libraries\dbi\DBIDummy();
$extension->setResult('SELECT @@basedir', $value);
$dbi = new PMA\libraries\DatabaseInterface($extension);
$this->assertEquals(
$expected,
$dbi->isAmazonRds()
);
}
/**
* Data provider for isAmazonRds() tests.
*
* @return array
*/
public function isAmazonRdsData()
{
return array(
array(array(array('/usr')), false),
array(array(array('E:/mysql')), false),
array(array(array('/rdsdbbin/mysql/')), true),
array(array(array('/rdsdbbin/mysql-5.7.18/')), true),
);
}
/**
* Test for version parsing
*