summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <hf@bison.(none)>2002-06-17 16:24:51 +0500
committerunknown <hf@bison.(none)>2002-06-17 16:24:51 +0500
commitf4b014d5c3ebac7e4c9eff57206d33f5fe6455ed (patch)
tree32ae61185744bab280ae5b44c652879d9331f198 /sql/sql_show.cc
parentc1f3be5bb5f70e5d0376f258b79ccffa5b2d9c2b (diff)
downloadmariadb-git-f4b014d5c3ebac7e4c9eff57206d33f5fe6455ed.tar.gz
Removing net emulation out of embedded library
include/mysql.h: Several structures content changed for embedded case include/violite.h: enum_vio_type extended libmysqld/embedded_priv.h: three new funcs added libmysqld/lib_sql.cc: A lot of changes on the way to excude network emulation libmysqld/lib_vio.c: vio structure changed. we're on the way to remove network... libmysqld/libmysqld.c: A lot of changes. sql/ha_myisam.cc: Network sending modified for embedded case. sql/net_pkg.cc: Exclude network from error sending sql/sql_acl.cc: Exclude access permissions checking in embedded case sql/sql_base.cc: Implementation of send_fields got quite different in enbedded case and now placed in lib_sql.cc sql/sql_class.cc: select_send::send_data for embedded case placed in lib_sql sql/sql_class.h: Extra fields added for embedded case sql/sql_parse.cc: remove this out of server sql/sql_show.cc: lots of similar changes to exclude network emulation sql/sql_table.cc: Network emulation excluded BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc50
1 files changed, 27 insertions, 23 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 849a803a622..d9c21b75ed9 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -52,8 +52,6 @@ extern struct st_VioSSLAcceptorFd * ssl_acceptor_fd;
** Send list of databases
** A database is a directory in the mysql_data_home directory
****************************************************************************/
-
-
int
mysqld_show_dbs(THD *thd,const char *wild)
{
@@ -85,8 +83,8 @@ mysqld_show_dbs(THD *thd,const char *wild)
{
thd->packet.length(0);
net_store_data(&thd->packet, thd->convert_set, file_name);
- if (my_net_write(&thd->net, (char*) thd->packet.ptr(),
- thd->packet.length()))
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)thd->packet.ptr(), thd->packet.length()))
DBUG_RETURN(-1);
}
}
@@ -123,8 +121,9 @@ int mysqld_show_open_tables(THD *thd,const char *wild)
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);
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)thd->packet.ptr(), thd->packet.length()))
+ DBUG_RETURN(-1);
}
send_eof(&thd->net);
@@ -162,8 +161,9 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild)
{
thd->packet.length(0);
net_store_data(&thd->packet, thd->convert_set, file_name);
- if (my_net_write(&thd->net,(char*) thd->packet.ptr(),thd->packet.length()))
- DBUG_RETURN(-1);
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)thd->packet.ptr(), thd->packet.length()))
+ DBUG_RETURN(-1);
}
send_eof(&thd->net);
DBUG_RETURN(0);
@@ -411,9 +411,9 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
}
close_thread_tables(thd,0);
}
- if (my_net_write(&thd->net,(char*) packet->ptr(),
- packet->length()))
- DBUG_RETURN(-1);
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)thd->packet.ptr(), thd->packet.length()))
+ DBUG_RETURN(-1);
}
send_eof(&thd->net);
DBUG_RETURN(0);
@@ -424,7 +424,6 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
/***************************************************************************
** List all columns in a table
***************************************************************************/
-
int
mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
bool verbose)
@@ -523,8 +522,8 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
if (verbose)
{
/* Add grant options */
- col_access= get_column_grant(thd,table_list,field) & COL_ACLS;
end=tmp;
+ col_access= get_column_grant(thd,table_list,field) & COL_ACLS;
for (uint bitnr=0; col_access ; col_access>>=1,bitnr++)
{
if (col_access & 1)
@@ -535,8 +534,9 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
}
net_store_data(packet,convert, tmp+1,end == tmp ? 0 : (uint) (end-tmp-1));
}
- if (my_net_write(&thd->net,(char*) packet->ptr(),packet->length()))
- DBUG_RETURN(1);
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)thd->packet.ptr(), thd->packet.length()))
+ DBUG_RETURN(-1);
}
}
}
@@ -591,8 +591,9 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
int3store(p, create_len);
// now we are in business :-)
- if (my_net_write(&thd->net, (char*)packet->ptr(), packet->length()))
- DBUG_RETURN(1);
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)thd->packet.ptr(), thd->packet.length()))
+ DBUG_RETURN(-1);
}
send_eof(&thd->net);
DBUG_RETURN(0);
@@ -714,8 +715,9 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
net_store_data(packet,convert,table->file->index_type(i));
/* Comment */
net_store_data(packet,convert,"");
- if (my_net_write(&thd->net,(char*) packet->ptr(),packet->length()))
- DBUG_RETURN(1); /* purecov: inspected */
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)thd->packet.ptr(), thd->packet.length()))
+ DBUG_RETURN(-1);
}
}
send_eof(&thd->net);
@@ -1126,8 +1128,9 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
net_store_data(packet,convert,thd_info->query);
else
net_store_null(packet);
- if (my_net_write(&thd->net,(char*) packet->ptr(),packet->length()))
- break; /* purecov: inspected */
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)thd->packet.ptr(), thd->packet.length()))
+ break;
}
send_eof(&thd->net);
DBUG_VOID_RETURN;
@@ -1372,8 +1375,9 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
#endif /* HAVE_OPENSSL */
}
- if (my_net_write(&thd->net, (char*) packet2.ptr(),packet2.length()))
- goto err; /* purecov: inspected */
+ if (SEND_ROW(thd, &thd->net, field_list.elements,
+ (char *)packet2.ptr(), packet2.length()))
+ goto err;
}
}
pthread_mutex_unlock(&LOCK_status);