Commit f860f4d3 authored by kostja@oak.local's avatar kostja@oak.local

minor authentification optimisation

parent 07a9b89f
...@@ -800,11 +800,10 @@ check_connection(THD *thd) ...@@ -800,11 +800,10 @@ check_connection(THD *thd)
/* Since 4.1 all database names are stored in utf8 */ /* Since 4.1 all database names are stored in utf8 */
if (db) if (db)
{ {
uint32 length= copy_and_convert(db_buff, sizeof(db_buff)-1, db_buff[copy_and_convert(db_buff, sizeof(db_buff)-1,
system_charset_info, system_charset_info,
db, strlen(db), db, strlen(db),
thd->charset()); thd->charset())]= 0;
db_buff[length]= 0;
db= db_buff; db= db_buff;
} }
...@@ -1191,6 +1190,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1191,6 +1190,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
password. New clients send the size (1 byte) + string (not null password. New clients send the size (1 byte) + string (not null
terminated, so also '\0' for empty string). terminated, so also '\0' for empty string).
*/ */
char db_buff[NAME_LEN+1]; // buffer to store db in utf8
char *db= passwd; char *db= passwd;
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
*passwd++ : strlen(passwd); *passwd++ : strlen(passwd);
...@@ -1203,10 +1203,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1203,10 +1203,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
} }
/* Convert database name to utf8 */ /* Convert database name to utf8 */
String convdb; db_buff[copy_and_convert(db_buff, sizeof(db_buff)-1,
convdb.copy(db, strlen(db), thd->variables.character_set_client, system_charset_info, db, strlen(db),
system_charset_info); thd->charset())]= 0;
db= convdb.c_ptr(); db= db_buff;
/* Save user and privileges */ /* Save user and privileges */
uint save_master_access= thd->master_access; uint save_master_access= thd->master_access;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment