bug with mysql_change_db() fixed

BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
This commit is contained in:
unknown 2001-03-21 17:09:43 +01:00
commit 9914932787
4 changed files with 5 additions and 3 deletions

View file

@ -264,9 +264,10 @@ bool mysql_change_db(THD *thd,const char *name)
send_error(&thd->net,ER_NO_DB_ERROR); /* purecov: inspected */
DBUG_RETURN(1); /* purecov: inspected */
}
if (length > NAME_LEN)
if ((length > NAME_LEN) || check_db_name(dbname))
{
net_printf(&thd->net,ER_WRONG_DB_NAME, dbname);
x_free(dbname);
DBUG_RETURN(1);
}
DBUG_PRINT("general",("Use database: %s", dbname));