Removed the 16 chars limitation for binlog file name
Removed the 16 chars limitation for binlog file name
This commit is contained in:
@ -45,7 +45,7 @@
|
|||||||
#include <memlog.h>
|
#include <memlog.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
#define BINLOG_FNAMELEN 16
|
#define BINLOG_FNAMELEN 255
|
||||||
#define BLR_PROTOCOL "MySQLBackend"
|
#define BLR_PROTOCOL "MySQLBackend"
|
||||||
#define BINLOG_MAGIC { 0xfe, 0x62, 0x69, 0x6e }
|
#define BINLOG_MAGIC { 0xfe, 0x62, 0x69, 0x6e }
|
||||||
#define BINLOG_NAMEFMT "%s.%06d"
|
#define BINLOG_NAMEFMT "%s.%06d"
|
||||||
|
@ -731,7 +731,10 @@ blr_make_binlog_dump(ROUTER_INSTANCE *router)
|
|||||||
{
|
{
|
||||||
GWBUF *buf;
|
GWBUF *buf;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int len = 0x1b;
|
int binlog_file_len = strlen(router->binlog_name);
|
||||||
|
/* COM_BINLOG_DUMP needs 11 bytes + binlogname (terminating NULL is not required) */
|
||||||
|
int len = 11 + binlog_file_len;
|
||||||
|
|
||||||
|
|
||||||
if ((buf = gwbuf_alloc(len + 4)) == NULL)
|
if ((buf = gwbuf_alloc(len + 4)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -745,8 +748,8 @@ int len = 0x1b;
|
|||||||
encode_value(&data[9], 0, 16); // Flags
|
encode_value(&data[9], 0, 16); // Flags
|
||||||
encode_value(&data[11],
|
encode_value(&data[11],
|
||||||
router->serverid, 32); // Server-id of MaxScale
|
router->serverid, 32); // Server-id of MaxScale
|
||||||
strncpy((char *)&data[15], router->binlog_name,
|
memcpy((char *)&data[15], router->binlog_name,
|
||||||
BINLOG_FNAMELEN); // binlog filename
|
binlog_file_len); // binlog filename
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user