[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_3, updated. RELEASE_3_3_4RC1-7-g4c0e653

Marc Delisle lem9 at users.sourceforge.net
Thu Jun 24 16:01:34 CEST 2010


The branch, QA_3_3 has been updated
       via  4c0e653de0aa48c277a2612f70d0c17442bf779c (commit)
      from  8b1b49a6b2dfc4da4c8ac8f2f3feda62e5894ce6 (commit)


- Log -----------------------------------------------------------------
commit 4c0e653de0aa48c277a2612f70d0c17442bf779c
Author: Stéphane Pontier <shadow_walker at users.sourceforge.net>
Date:   Thu Jun 24 10:01:21 2010 -0400

    patch #2932113 Slow export when having lots of databases

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |    2 ++
 libraries/mysql_charsets.lib.php |   12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d259bac..6200919 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@ $Id$
 $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $
 
 3.3.5.0 (not yet released)
+- patch #2932113 [information_schema] Slow export when having lots of
+  databases, thanks to Stéphane Pontier - shadow_walker
 
 3.3.4.0 (not yet released)
 - bug #2996161 [import] properly escape import value
diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php
index b0274d2..0b583d6 100644
--- a/libraries/mysql_charsets.lib.php
+++ b/libraries/mysql_charsets.lib.php
@@ -164,7 +164,17 @@ function PMA_getDbCollation($db) {
         return 'utf8_general_ci';
     }
 
-    return PMA_DBI_fetch_value('SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = \'' . PMA_sqlAddSlashes($db) . '\' LIMIT 1;');
+    if (! $GLOBALS['cfg']['Server']['DisableIS']) {
+        // this is slow with thousands of databases
+        return PMA_DBI_fetch_value('SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = \'' . PMA_sqlAddSlashes($db) . '\' LIMIT 1;');
+    } else {
+        PMA_DBI_select_db($db);
+        $return = PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'collation_database\'', 0, 1);
+        if ($db !== $GLOBALS['db']) {
+            PMA_DBI_select_db($GLOBALS['db']);
+        }
+        return $return;
+    }
 }
 
 /**


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list