do not use UNION DISTINCT

This commit is contained in:
Marc Delisle
2005-12-04 19:51:23 +00:00
parent 4a89855656
commit ef4ea978e1
2 changed files with 7 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ $Source$
2005-12-04 Marc Delisle <lem9@users.sourceforge.net> 2005-12-04 Marc Delisle <lem9@users.sourceforge.net>
* lang/catalan update, thanks to Xavier Navarro (xavin). * lang/catalan update, thanks to Xavier Navarro (xavin).
* server_privileges.php: do not use UNION DISTINCT, as it's not allowed
before MySQL 4.0.17, and because "it does nothing" (cf manual)
2005-12-04 Michal Čihař <michal@cihar.com> 2005-12-04 Michal Čihař <michal@cihar.com>
* pdf_schema.php: Bad copy and paste, here should be iso-8859-2 (thanks * pdf_schema.php: Bad copy and paste, here should be iso-8859-2 (thanks

View File

@@ -1334,8 +1334,10 @@ if ( empty( $adduser ) && empty( $checkprivs ) ) {
// for the rights // for the rights
$db_rights = array(); $db_rights = array();
// do not use UNION DISTINCT, as it's not allowed before
// MySQL 4.0.17, and because "it does nothing" (cf manual)
if ( PMA_MYSQL_INT_VERSION >= 40000 ) { if ( PMA_MYSQL_INT_VERSION >= 40000 ) {
$db_rights_sql = '(' . implode( ') UNION DISTINCT (', $db_rights_sqls ) . ')' $db_rights_sql = '(' . implode( ') UNION (', $db_rights_sqls ) . ')'
.' ORDER BY `User` ASC, `Host` ASC'; .' ORDER BY `User` ASC, `Host` ASC';
$db_rights_result = PMA_DBI_query( $db_rights_sql ); $db_rights_result = PMA_DBI_query( $db_rights_sql );
@@ -1625,7 +1627,7 @@ if ( empty( $adduser ) && empty( $checkprivs ) ) {
$db_rights = array(); $db_rights = array();
if ( PMA_MYSQL_INT_VERSION >= 40000 ) { if ( PMA_MYSQL_INT_VERSION >= 40000 ) {
$db_rights_sql = '(' . implode( ') UNION DISTINCT (', $db_rights_sqls ) . ')' $db_rights_sql = '(' . implode( ') UNION (', $db_rights_sqls ) . ')'
.' ORDER BY `Db` ASC'; .' ORDER BY `Db` ASC';
$db_rights_result = PMA_DBI_query( $db_rights_sql ); $db_rights_result = PMA_DBI_query( $db_rights_sql );
@@ -1703,7 +1705,7 @@ if ( empty( $adduser ) && empty( $checkprivs ) ) {
$db_rights = array(); $db_rights = array();
if ( PMA_MYSQL_INT_VERSION >= 40000 ) { if ( PMA_MYSQL_INT_VERSION >= 40000 ) {
$db_rights_sql = '(' . implode( ') UNION DISTINCT (', $db_rights_sqls ) . ')' $db_rights_sql = '(' . implode( ') UNION (', $db_rights_sqls ) . ')'
.' ORDER BY `Table_name` ASC'; .' ORDER BY `Table_name` ASC';
$db_rights_result = PMA_DBI_query( $db_rights_sql ); $db_rights_result = PMA_DBI_query( $db_rights_sql );