diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-02-12 14:14:11 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-02-12 14:14:11 +0000 |
| commit | 81b77c261f92b7b72ebfa3e6d4ffe5ac5d229798 (patch) | |
| tree | b20d1d951b0b6d59e37107db1d541334f9dffdb0 /roundcubemail/program/include/rcube_user.php | |
| parent | 6bca90e74d715dad55ea0877c37b8c1af26a82dc (diff) | |
Move BINARY modifier to make MYSQL use index again
git-svn-id: https://svn.roundcube.net/trunk@4532 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_user.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_user.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/roundcubemail/program/include/rcube_user.php b/roundcubemail/program/include/rcube_user.php index ca4fb8b0c..ba5613554 100644 --- a/roundcubemail/program/include/rcube_user.php +++ b/roundcubemail/program/include/rcube_user.php @@ -359,12 +359,11 @@ class rcube_user $dbh = rcmail::get_instance()->get_dbh(); // use BINARY (case-sensitive) comparison on MySQL, other engines are case-sensitive - $prefix = preg_match('/^mysql/', $dbh->db_provider) ? 'BINARY ' : ''; + $mod = preg_match('/^mysql/', $dbh->db_provider) ? 'BINARY' : ''; // query for matching user name - $query = "SELECT * FROM ".get_table_name('users')." WHERE mail_host = ? AND %s = ?"; - - $sql_result = $dbh->query(sprintf($query, $prefix.'username'), $host, $user); + $query = "SELECT * FROM ".get_table_name('users')." WHERE mail_host = ? AND username = $mod ?"; + $sql_result = $dbh->query($query, $host, $user); // query for matching alias if (!($sql_arr = $dbh->fetch_assoc($sql_result))) { |
