better use default values in the fonction

This commit is contained in:
Marc Delisle
2004-07-25 21:20:10 +00:00
parent 837639360f
commit e18937d5d2
2 changed files with 3 additions and 3 deletions

View File

@@ -685,7 +685,7 @@ if ($is_minimum_common == FALSE) {
*
* @access private
*/
function PMA_charsetIntroducerCollate($original_string, $charset_introducer, $collation)
function PMA_charsetIntroducerCollate($original_string, $charset_introducer='_latin1', $collation='latin1_swedish_ci')
{
$result = '';
if (PMA_MYSQL_INT_VERSION >= 40100) {

View File

@@ -183,7 +183,7 @@ if ($server > 0) {
$is_superuser = PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user', $userlink, PMA_DBI_QUERY_STORE);
if ($dbh) {
// TODO: do we need to check the charset and collation of mysql.user?
$local_query = 'SELECT Create_priv, Reload_priv FROM mysql.user WHERE User = ' . PMA_charsetIntroducerCollate(PMA_sqlAddslashes($mysql_cur_user),'_latin1', 'latin1_swedish_ci') . ';';
$local_query = 'SELECT Create_priv, Reload_priv FROM mysql.user WHERE User = ' . PMA_charsetIntroducerCollate(PMA_sqlAddslashes($mysql_cur_user)) . ';';
$rs_usr = PMA_DBI_try_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
if ($rs_usr) {
while ($result_usr = PMA_DBI_fetch_assoc($rs_usr)) {
@@ -202,7 +202,7 @@ if ($server > 0) {
// the first inexistant db name that we find, in most cases it's probably
// the one he just dropped :)
if (!$is_create_priv) {
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Create_priv = ' . PMA_charsetIntroducerCollate('Y','_latin1','latin1_swedish_ci') . ' AND User = ' . PMA_charsetIntroducerCollate(PMA_sqlAddslashes($mysql_cur_user),'_latin1','latin1_swedish_ci') . ';';
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Create_priv = ' . PMA_charsetIntroducerCollate('Y') . ' AND User = ' . PMA_charsetIntroducerCollate(PMA_sqlAddslashes($mysql_cur_user)) . ';';
$rs_usr = PMA_DBI_try_query($local_query, $dbh, PMA_DBI_QUERY_STORE);
if ($rs_usr) {
$re0 = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards