summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-05-26 16:53:57 +0300
committerunknown <monty@hundin.mysql.fi>2002-05-26 16:53:57 +0300
commit6ec00a6692b54d5e8e69229404d6da97c0314beb (patch)
tree3bbf074db5beece05e46cace37fd9417120b5366
parent31990c309dbaaa347b65545cad2473bb884c13f8 (diff)
downloadmariadb-git-6ec00a6692b54d5e8e69229404d6da97c0314beb.tar.gz
Fixed core dump bug in mysqltest
Added DBUG_ code to lib_vio.c client/mysqltest.c: Fixed core dump bug libmysqld/lib_vio.c: Added DBUG_ code
-rw-r--r--client/mysqltest.c4
-rw-r--r--libmysqld/lib_vio.c21
2 files changed, 16 insertions, 9 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index f2dd19424d1..27763736f96 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -42,7 +42,7 @@
**********************************************************************/
-#define MTEST_VERSION "1.21"
+#define MTEST_VERSION "1.22"
#include <my_global.h>
#include <mysql_embed.h>
@@ -1451,7 +1451,7 @@ int do_connect(struct st_query* q)
if (!con_db[0])
con_db=db;
/* Special database to allow one to connect without a database name */
- if (!strcmp(con_db,"*NO-ONE*"))
+ if (con_db && !strcmp(con_db,"*NO-ONE*"))
con_db=0;
if ((con_error = safe_connect(&next_con->mysql, con_host,
con_user, con_pass,
diff --git a/libmysqld/lib_vio.c b/libmysqld/lib_vio.c
index 9bf492ed5ea..5460c546faa 100644
--- a/libmysqld/lib_vio.c
+++ b/libmysqld/lib_vio.c
@@ -61,15 +61,16 @@ struct st_vio
Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost)
{
- Vio * vio = NULL;
- vio = (Vio *) my_malloc (sizeof(*vio),MYF(MY_WME|MY_ZEROFILL));
- if (vio)
+ DBUG_ENTER("vio_new");
+ Vio * vio;
+
+ if ((vio= (Vio *) my_malloc(sizeof(*vio),MYF(MY_WME|MY_ZEROFILL))))
{
init_alloc_root(&vio->root, 8192, 8192);
vio->root.min_malloc = sizeof(char *) + 4;
vio->last_packet = &vio->packets;
}
- return (vio);
+ DBUG_RETURN(vio);
}
@@ -84,19 +85,24 @@ Vio *vio_new_win32pipe(HANDLE hPipe)
void vio_delete(Vio * vio)
{
+ DBUG_ENTER("vio_delete");
if (vio)
{
- if (vio->type != VIO_CLOSED) vio_close(vio);
+ if (vio->type != VIO_CLOSED)
+ vio_close(vio);
free_root(&vio->root, MYF(0));
- my_free((gptr)vio, MYF(0));
+ my_free((gptr) vio, MYF(0));
}
+ DBUG_VOID_RETURN;
}
void vio_reset(Vio *vio)
{
+ DBUG_ENTER("vio_reset");
free_root(&vio->root, MYF(MY_KEEP_PREALLOC));
vio->packets = vio->where_in_packet = vio->end_of_packet = 0;
vio->last_packet = &vio->packets;
+ DBUG_VOID_RETURN;
}
int vio_errno(Vio *vio __attribute__((unused)))
@@ -124,6 +130,7 @@ int vio_read(Vio * vio, gptr buf, int size)
int vio_write(Vio * vio, const gptr buf, int size)
{
+ DBUG_ENTER("vio_write");
char *packet;
if (vio->reading)
{
@@ -141,7 +148,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
}
else
size= -1;
- return (size);
+ DBUG_RETURN(size);
}
int vio_blocking(Vio * vio, my_bool set_blocking_mode)