Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurĂ­cio Meneghini Fauth <mauricio@fauth.dev>2022-08-23 03:15:57 +0300
committerGitHub <noreply@github.com>2022-08-23 03:15:57 +0300
commit6ed03b3f00832f6186ef8a0ed0fdda0cd3315b87 (patch)
tree1998fa3171dbd6bd22e8c02fbbd73270aa367743
parent84e30c2c8605f21f3086115859d8d121ee8df667 (diff)
parentac7fd21ecbb96c5339c027a53c07a1e602fdedb5 (diff)
Merge pull request #17691 from kamil-tekiela/Fix-incomplete-test
Fix incomplete Privileges test
-rw-r--r--libraries/classes/Server/Privileges.php7
-rw-r--r--test/classes/Server/PrivilegesTest.php4
2 files changed, 5 insertions, 6 deletions
diff --git a/libraries/classes/Server/Privileges.php b/libraries/classes/Server/Privileges.php
index ff1d329e51..27198284f6 100644
--- a/libraries/classes/Server/Privileges.php
+++ b/libraries/classes/Server/Privileges.php
@@ -1698,10 +1698,9 @@ class Privileges
continue;
}
- $dbRightsSqls[] = '
- SELECT DISTINCT `' . $dbOrTableName . '`
- FROM `mysql`.' . Util::backquote($tableSearchIn)
- . $userHostCondition;
+ $dbRightsSqls[] = 'SELECT DISTINCT `' . $dbOrTableName
+ . '` FROM `mysql`.' . Util::backquote($tableSearchIn)
+ . $userHostCondition;
}
$userDefaults = [
diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php
index 2a2a1ebba7..5cebb3d763 100644
--- a/test/classes/Server/PrivilegesTest.php
+++ b/test/classes/Server/PrivilegesTest.php
@@ -1636,7 +1636,7 @@ class PrivilegesTest extends AbstractTestCase
);
// phpcs:disable Generic.Files.LineLength.TooLong
$dummyDbi->addResult(
- '( SELECT DISTINCT `Table_name` FROM `mysql`.`columns_priv` WHERE `User` = \'pma\' AND `Host` = \'host\' AND `Db` LIKE \'pmadb\') ORDER BY `Table_name` ASC',
+ '(SELECT DISTINCT `Table_name` FROM `mysql`.`columns_priv` WHERE `User` = \'pma\' AND `Host` = \'host\' AND `Db` LIKE \'pmadb\') ORDER BY `Table_name` ASC',
[],
['Table_name']
);
@@ -1646,7 +1646,7 @@ class PrivilegesTest extends AbstractTestCase
['Table_name', 'Table_priv', 'Column_priv']
);
$dummyDbi->addResult(
- '( SELECT DISTINCT `Db` FROM `mysql`.`tables_priv` WHERE `User` = \'pma2\' AND `Host` = \'host2\') UNION ( SELECT DISTINCT `Db` FROM `mysql`.`columns_priv` WHERE `User` = \'pma2\' AND `Host` = \'host2\') ORDER BY `Db` ASC',
+ '(SELECT DISTINCT `Db` FROM `mysql`.`tables_priv` WHERE `User` = \'pma2\' AND `Host` = \'host2\') UNION (SELECT DISTINCT `Db` FROM `mysql`.`columns_priv` WHERE `User` = \'pma2\' AND `Host` = \'host2\') ORDER BY `Db` ASC',
[],
['Db']
);