Commit 4ee94d21 authored by unknown's avatar unknown

Database name and national characters fixes.

parent 180b101f
......@@ -42,3 +42,17 @@ Field Type Null Key Default Extra
SET CHARACTER SET koi8r;
DROP TABLE ;
SET CHARACTER SET default;
SET CHARACTER SET koi8r;
CREATE DATABASE ;
USE ;
SHOW TABLES;
Tables_in_
SHOW TABLES IN ;
Tables_in_
SET CHARACTER SET cp1251;
SHOW TABLES;
Tables_in_
SHOW TABLES IN ;
Tables_in_
SET CHARACTER SET koi8r;
DROP DATABASE ;
......@@ -27,3 +27,14 @@ SHOW FIELDS FROM таблица;
SET CHARACTER SET koi8r;
DROP TABLE ;
SET CHARACTER SET default;
SET CHARACTER SET koi8r;
CREATE DATABASE ;
USE ;
SHOW TABLES;
SHOW TABLES IN ;
SET CHARACTER SET cp1251;
SHOW TABLES;
SHOW TABLES IN ;
SET CHARACTER SET koi8r;
DROP DATABASE ;
......@@ -549,6 +549,7 @@ check_connections(THD *thd)
char *end, *user, *passwd, *db;
char prepared_scramble[SCRAMBLE41_LENGTH+4]; /* Buffer for scramble&hash */
ACL_USER* cached_user=NULL; /* Initialise to NULL for first stage */
String convdb;
DBUG_PRINT("info",("New connection received on %s",
vio_description(net->vio)));
......@@ -724,7 +725,12 @@ check_connections(THD *thd)
db=0;
using_password= test(passwd[0]);
if (thd->client_capabilities & CLIENT_CONNECT_WITH_DB)
{
db=strend(passwd)+1;
convdb.copy(db, strlen(db),
thd->variables.character_set_client, system_charset_info);
db= convdb.c_ptr();
}
/* We can get only old hash at this point */
if (using_password && strlen(passwd) != SCRAMBLE_LENGTH)
......@@ -1125,10 +1131,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->lex.select_lex.options=0; // We store status here
switch (command) {
case COM_INIT_DB:
statistic_increment(com_stat[SQLCOM_CHANGE_DB],&LOCK_status);
if (!mysql_change_db(thd,packet))
mysql_log.write(thd,command,"%s",thd->db);
break;
{
String convname;
statistic_increment(com_stat[SQLCOM_CHANGE_DB],&LOCK_status);
convname.copy(packet, strlen(packet),
thd->variables.character_set_client, system_charset_info);
if (!mysql_change_db(thd,convname.c_ptr()))
mysql_log.write(thd,command,"%s",thd->db);
break;
}
#ifndef EMBEDDED_LIBRARY
case COM_REGISTER_SLAVE:
{
......
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