Commit a4f9ef96 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Use a tag flag to mark binary log records

parent 67252219
......@@ -111,6 +111,11 @@ extern const char *VSL_tags[SLT__MAX];
* Tag to string array. Contains NULL for invalid tags.
*/
extern unsigned VSL_tagflags[SLT__MAX];
/*
* Tag flags array.
*/
int VSL_Name2Tag(const char *name, int l);
/*
* Convert string to tag number (= enum VSL_tag_e). Name can be a
......
......@@ -63,6 +63,12 @@ const char *VSL_tags[SLT__MAX] = {
# undef SLTM
};
unsigned VSL_tagflags[SLT__MAX] = {
# define SLTM(foo, flags, sdesc, ldesc) [SLT_##foo] = flags,
# include "tbl/vsl_tags.h"
# undef SLTM
};
int
vsl_diag(struct VSL_data *vsl, const char *fmt, ...)
{
......@@ -246,7 +252,7 @@ VSL_Print(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
'b' : '-';
data = VSL_CDATA(c->rec.ptr);
if (tag == SLT_Debug) {
if (VSL_tagflags[tag] & SLT_F_BINARY) {
VSL_PRINT(fo, "%10u %-14s %c \"", vxid, VSL_tags[tag], type);
while (len-- > 0) {
if (*data >= ' ' && *data <= '~')
......@@ -279,7 +285,7 @@ VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
len = VSL_LEN(c->rec.ptr);
data = VSL_CDATA(c->rec.ptr);
if (tag == SLT_Debug) {
if (VSL_tagflags[tag] & SLT_F_BINARY) {
VSL_PRINT(fo, "%-14s \"", VSL_tags[tag]);
while (len-- > 0) {
if (*data >= ' ' && *data <= '~')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment