summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-03-19 21:56:14 +0200
committerunknown <monty@narttu.mysql.fi>2003-03-19 21:56:14 +0200
commit7517a59a6dac4580b1f7b5cf87abf6d75b096bbc (patch)
treed69e3b047e341585048a562045623a1b77a71700 /sql
parentb4a0cdb8dea6fccacc086f0a043105b3cef6b38c (diff)
parent0847c4f90e732378b6e4b37fe819c92bda870067 (diff)
downloadmariadb-git-7517a59a6dac4580b1f7b5cf87abf6d75b096bbc.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into narttu.mysql.fi:/my/mysql-4.0
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc9
-rw-r--r--sql/sql_parse.cc3
-rw-r--r--sql/sql_show.cc4
3 files changed, 13 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index ebae0d5e901..6e3f8486b45 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -121,8 +121,15 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
#endif
case DB_TYPE_HEAP:
return new ha_heap(table);
- case DB_TYPE_MYISAM:
default: // should never happen
+ {
+ enum db_type def=(enum db_type) current_thd->variables.table_type;
+ /* Try first with 'default table type' */
+ if (db_type != def)
+ return get_new_handler(table, def);
+ }
+ /* Fall back to MyISAM */
+ case DB_TYPE_MYISAM:
return new ha_myisam(table);
case DB_TYPE_MRG_MYISAM:
return new ha_myisammrg(table);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index dde4b6c5c93..8439db0be6b 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -499,7 +499,10 @@ check_connections(THD *thd)
thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors);
/* Cut very long hostnames to avoid possible overflows */
if (thd->host)
+ {
thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0;
+ thd->host_or_ip= thd->host;
+ }
if (connect_errors > max_connect_errors)
return(ER_HOST_IS_BLOCKED);
}
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 95197ecfc4b..23e5049636a 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1064,10 +1064,10 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
{
if ((thd_info->host= thd->alloc(LIST_PROCESS_HOST_LEN+1)))
my_snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN,
- "%s:%u", thd->host_or_ip, tmp->peer_port);
+ "%s:%u", tmp->host_or_ip, tmp->peer_port);
}
else
- thd_info->host= thd->strdup(thd->host_or_ip);
+ thd_info->host= thd->strdup(tmp->host_or_ip);
if ((thd_info->db=tmp->db)) // Safe test
thd_info->db=thd->strdup(thd_info->db);
thd_info->command=(int) tmp->command;