3909 Praveenkumar Hulakund 2012-02-15
Bug#12951586 - 62285: DON'T INITIALIZE VIO STRING DESCRIPTION, CREATE IT ON
DEMAND
Fix:
Moved VIO DESCRIPTION STRING initialization to function vio_description.
modified:
include/violite.h
vio/vio.c
vio/viosocket.c
3908 Sunny Bains 2012-02-15
Bug#12407434 60776: INNODB MAX PURGE LAG SETTING IS WRONGLY DESIGNED
Add a test for the new variable introduced by this fix.
added:
mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result
mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test
=== modified file 'include/violite.h'
--- a/include/violite.h 2011-08-19 15:18:57 +0000
+++ b/include/violite.h 2012-02-15 07:20:32 +0000
@@ -54,6 +54,7 @@ enum enum_vio_io_event
#define VIO_LOCALHOST 1 /* a localhost connection */
#define VIO_BUFFERED_READ 2 /* use buffered read */
#define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */
+#define VIO_DESCRIPTION_SIZE 30 /* size of description */
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
Vio* mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags);
@@ -214,7 +215,11 @@ struct st_vio
struct sockaddr_storage remote; /* Remote internet address */
int addrLen; /* Length of remote address */
enum enum_vio_type type; /* Type of connection */
- char desc[30]; /* String description */
+ char desc[VIO_DESCRIPTION_SIZE]; /* Description string. This
+ member MUST NOT be
+ used directly, but only
+ via function
+ "vio_description" */
char *read_buffer; /* buffer for vio_read_buff */
char *read_pos; /* start of unfetched data in the
read buffer */
=== modified file 'vio/vio.c'
--- a/vio/vio.c 2011-08-18 05:29:13 +0000
+++ b/vio/vio.c 2012-02-15 07:20:32 +0000
@@ -217,8 +217,6 @@ Vio *mysql_socket_vio_new(MYSQL_SOCKET m
if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME))))
{
vio_init(vio, type, sd, flags);
- sprintf(vio->desc,
- (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"), sd);
vio->mysql_socket= mysql_socket;
}
DBUG_RETURN(vio);
=== modified file 'vio/viosocket.c'
--- a/vio/viosocket.c 2011-08-29 12:08:58 +0000
+++ b/vio/viosocket.c 2012-02-15 07:20:32 +0000
@@ -430,6 +430,12 @@ int vio_close(Vio * vio)
const char *vio_description(Vio * vio)
{
+ if (!vio->desc[0])
+ {
+ my_snprintf(vio->desc, VIO_DESCRIPTION_SIZE,
+ (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
+ mysql_socket_getfd(vio->mysql_socket));
+ }
return vio->desc;
}
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (praveenkumar.hulakund:3908 to 3909)Bug#12951586 | Praveenkumar Hulakund | 15 Feb |