Commit e423faaf authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

Database name and national characters fixes.

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