summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.fi>2001-07-11 10:36:22 +0300
committerunknown <monty@tik.mysql.fi>2001-07-11 10:36:22 +0300
commit961cd9e91a05864e6fcaccc9ed2fd41b1ce0be07 (patch)
tree67dbdcecf5e9d4f027232016900ded0552e4f5bd /sql/sql_show.cc
parentbfefbf8b3b05f3cefe3dda0d8e1454af7237527e (diff)
downloadmariadb-git-961cd9e91a05864e6fcaccc9ed2fd41b1ce0be07.tar.gz
Added back old code that Sasha removed
mysql-test/r/show_check.result: Added back old code sql/ha_myisam.h: Removed warning sql/mysql_priv.h: Added back old code sql/sql_base.cc: Added back old code sql/sql_parse.cc: Added back old code sql/sql_show.cc: Added back old code
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc27
1 files changed, 12 insertions, 15 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 8a4443f8a47..4ed59f7d1b0 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -95,21 +95,17 @@ mysqld_show_dbs(THD *thd,const char *wild)
** List all open tables in a database
***************************************************************************/
-int mysqld_show_open_tables(THD *thd,const char *db,const char *wild)
+int mysqld_show_open_tables(THD *thd,const char *wild)
{
- Item_string *field=new Item_string("",0);
List<Item> field_list;
- char *end,*table_name;
- List<char> tables;
+ OPEN_TABLE_LIST *open_list;
+ CONVERT *convert=thd->convert_set;
DBUG_ENTER("mysqld_show_open_tables");
- field->name=(char*) thd->alloc(20+(uint) strlen(db)+(wild ? (uint) strlen(wild)+4:0));
- end=strxmov(field->name,"Open_tables_in_",db,NullS);
- if (wild && wild[0])
- strxmov(end," (",wild,")",NullS);
- field->max_length=NAME_LEN;
- field_list.push_back(field);
- field_list.push_back(new Item_empty_string("Comment",80));
+ field_list.push_back(new Item_empty_string("Database",NAME_LEN));
+ field_list.push_back(new Item_empty_string("Table",NAME_LEN));
+ field_list.push_back(new Item_int("In_use",0, 4));
+ field_list.push_back(new Item_int("Name_locked",0, 4));
if (send_fields(thd,field_list,1))
DBUG_RETURN(1);
@@ -117,12 +113,13 @@ int mysqld_show_open_tables(THD *thd,const char *db,const char *wild)
if (!(open_list=list_open_tables(thd,wild)) && thd->fatal_error)
DBUG_RETURN(-1);
- List_iterator<char> it(tables);
- while ((table_name=it++))
+ for ( ; open_list ; open_list=open_list->next)
{
thd->packet.length(0);
- net_store_data(&thd->packet,table_name);
- net_store_data(&thd->packet,query_table_status(thd,db,table_name));
+ net_store_data(&thd->packet,convert, open_list->db);
+ net_store_data(&thd->packet,convert, open_list->table);
+ net_store_data(&thd->packet,open_list->in_use);
+ net_store_data(&thd->packet,open_list->locked);
if (my_net_write(&thd->net,(char*) thd->packet.ptr(),thd->packet.length()))
DBUG_RETURN(-1);
}