1143
1058
if (!ev || !ev->is_valid())
1146
#ifdef DRIZZLE_CLIENT
1147
if (!force_opt) /* then mysqlbinlog dies */
1149
*error= "Found invalid event in binary log";
1152
ev= new Unknown_log_event(buf, description_event);
1154
1061
*error= "Found invalid event in binary log";
1161
#ifdef DRIZZLE_CLIENT
1164
Log_event::print_header()
1167
void Log_event::print_header(IO_CACHE* file,
1168
PRINT_EVENT_INFO* print_event_info,
1169
bool is_more __attribute__((unused)))
1172
my_off_t hexdump_from= print_event_info->hexdump_from;
1174
my_b_printf(file, "#");
1175
print_timestamp(file);
1176
my_b_printf(file, " server id %d end_log_pos %s ", server_id,
1177
llstr(log_pos,llbuff));
1179
/* mysqlbinlog --hexdump */
1180
if (print_event_info->hexdump_from)
1182
my_b_printf(file, "\n");
1183
uchar *ptr= (uchar*)temp_buf;
1185
uint4korr(ptr + EVENT_LEN_OFFSET) - LOG_EVENT_MINIMAL_HEADER_LEN;
1188
/* Header len * 4 >= header len * (2 chars + space + extra space) */
1189
char *h, hex_string[LOG_EVENT_MINIMAL_HEADER_LEN*4]= {0};
1190
char *c, char_string[16+1]= {0};
1192
/* Pretty-print event common header if header is exactly 19 bytes */
1193
if (print_event_info->common_header_len == LOG_EVENT_MINIMAL_HEADER_LEN)
1195
char emit_buf[256]; // Enough for storing one line
1196
my_b_printf(file, "# Position Timestamp Type Master ID "
1197
"Size Master Pos Flags \n");
1198
int const bytes_written=
1199
snprintf(emit_buf, sizeof(emit_buf),
1200
"# %8.8lx %02x %02x %02x %02x %02x "
1201
"%02x %02x %02x %02x %02x %02x %02x %02x "
1202
"%02x %02x %02x %02x %02x %02x\n",
1203
(unsigned long) hexdump_from,
1204
ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6],
1205
ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13],
1206
ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]);
1207
assert(bytes_written >= 0);
1208
assert(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
1209
my_b_write(file, (uchar*) emit_buf, bytes_written);
1210
ptr += LOG_EVENT_MINIMAL_HEADER_LEN;
1211
hexdump_from += LOG_EVENT_MINIMAL_HEADER_LEN;
1214
/* Rest of event (without common header) */
1215
for (i= 0, c= char_string, h=hex_string;
1219
snprintf(h, 4, "%02x ", *ptr);
1222
*c++= my_isalnum(&my_charset_bin, *ptr) ? *ptr : '.';
1227
my_b_printf() does not support full printf() formats, so we
1228
have to do it this way.
1230
TODO: Rewrite my_b_printf() to support full printf() syntax.
1233
int const bytes_written=
1234
snprintf(emit_buf, sizeof(emit_buf),
1235
"# %8.8lx %-48.48s |%16s|\n",
1236
(unsigned long) (hexdump_from + (i & 0xfffffff0)),
1237
hex_string, char_string);
1238
assert(bytes_written >= 0);
1239
assert(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
1240
my_b_write(file, (uchar*) emit_buf, bytes_written);
1246
else if (i % 8 == 7) *h++ = ' ';
1253
int const bytes_written=
1254
snprintf(emit_buf, sizeof(emit_buf),
1255
"# %8.8lx %-48.48s |%s|\n",
1256
(unsigned long) (hexdump_from + (i & 0xfffffff0)),
1257
hex_string, char_string);
1258
assert(bytes_written >= 0);
1259
assert(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
1260
my_b_write(file, (uchar*) emit_buf, bytes_written);
1263
need a # to prefix the rest of printouts for example those of
1264
Rows_log_event::print_helper().
1266
my_b_write(file, reinterpret_cast<const uchar*>("# "), 2);
1272
void Log_event::print_base64(IO_CACHE* file,
1273
PRINT_EVENT_INFO* print_event_info,
1276
const uchar *ptr= (const uchar *)temp_buf;
1277
uint32_t size= uint4korr(ptr + EVENT_LEN_OFFSET);
1279
size_t const tmp_str_sz= base64_needed_encoded_length((int) size);
1280
char *const tmp_str= (char *) my_malloc(tmp_str_sz, MYF(MY_WME));
1282
fprintf(stderr, "\nError: Out of memory. "
1283
"Could not print correct binlog event.\n");
1287
if (base64_encode(ptr, (size_t) size, tmp_str))
1292
if (my_b_tell(file) == 0)
1293
my_b_printf(file, "\nBINLOG '\n");
1295
my_b_printf(file, "%s\n", tmp_str);
1298
my_b_printf(file, "'%s\n", print_event_info->delimiter);
1300
my_free(tmp_str, MYF(0));
1306
Log_event::print_timestamp()
1309
void Log_event::print_timestamp(IO_CACHE* file, time_t* ts)
1314
#ifdef DRIZZLE_SERVER // This is always false
1316
localtime_r(ts,(res= &tm_tmp));
1321
my_b_printf(file,"%02d%02d%02d %2d:%02d:%02d",
1331
#endif /* DRIZZLE_CLIENT */
1334
#if !defined(DRIZZLE_CLIENT) && defined(HAVE_REPLICATION)
1335
1067
inline Log_event::enum_skip_reason
1336
1068
Log_event::continue_group(Relay_log_info *rli)
1938
#ifdef DRIZZLE_CLIENT
1940
Query_log_event::print().
1943
print the catalog ??
1945
void Query_log_event::print_query_header(IO_CACHE* file,
1946
PRINT_EVENT_INFO* print_event_info)
1948
// TODO: print the catalog ??
1949
char buff[40],*end; // Enough for SET TIMESTAMP
1950
bool different_db= 1;
1953
if (!print_event_info->short_form)
1955
print_header(file, print_event_info, false);
1956
my_b_printf(file, "\t%s\tthread_id=%lu\texec_time=%lu\terror_code=%d\n",
1957
get_type_str(), (ulong) thread_id, (ulong) exec_time,
1961
if (!(flags & LOG_EVENT_SUPPRESS_USE_F) && db)
1963
if ((different_db= memcmp(print_event_info->db, db, db_len + 1)))
1964
memcpy(print_event_info->db, db, db_len + 1);
1965
if (db[0] && different_db)
1966
my_b_printf(file, "use %s%s\n", db, print_event_info->delimiter);
1969
end=int10_to_str((long) when, my_stpcpy(buff,"SET TIMESTAMP="),10);
1970
end= my_stpcpy(end, print_event_info->delimiter);
1972
my_b_write(file, (uchar*) buff, (uint) (end-buff));
1973
if ((!print_event_info->thread_id_printed ||
1974
((flags & LOG_EVENT_THREAD_SPECIFIC_F) &&
1975
thread_id != print_event_info->thread_id)))
1977
// If --short-form, print deterministic value instead of pseudo_thread_id.
1978
my_b_printf(file,"SET @@session.pseudo_thread_id=%lu%s\n",
1979
short_form ? 999999999 : (ulong)thread_id,
1980
print_event_info->delimiter);
1981
print_event_info->thread_id= thread_id;
1982
print_event_info->thread_id_printed= 1;
1986
If flags2_inited==0, this is an event from 3.23 or 4.0; nothing to
1987
print (remember we don't produce mixed relay logs so there cannot be
1988
5.0 events before that one so there is nothing to reset).
1990
if (likely(flags2_inited)) /* likely as this will mainly read 5.0 logs */
1992
/* tmp is a bitmask of bits which have changed. */
1993
if (likely(print_event_info->flags2_inited))
1994
/* All bits which have changed */
1995
tmp= (print_event_info->flags2) ^ flags2;
1996
else /* that's the first Query event we read */
1998
print_event_info->flags2_inited= 1;
1999
tmp= ~((uint32_t)0); /* all bits have changed */
2002
if (unlikely(tmp)) /* some bits have changed */
2005
my_b_printf(file, "SET ");
2006
print_set_option(file, tmp, OPTION_NO_FOREIGN_KEY_CHECKS, ~flags2,
2007
"@@session.foreign_key_checks", &need_comma);
2008
print_set_option(file, tmp, OPTION_RELAXED_UNIQUE_CHECKS, ~flags2,
2009
"@@session.unique_checks", &need_comma);
2010
my_b_printf(file,"%s\n", print_event_info->delimiter);
2011
print_event_info->flags2= flags2;
2016
Now the session variables;
2017
it's more efficient to pass SQL_MODE as a number instead of a
2018
comma-separated list.
2019
FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS are session-only
2020
variables (they have no global version; they're not listed in
2021
sql_class.h), The tests below work for pure binlogs or pure relay
2022
logs. Won't work for mixed relay logs but we don't create mixed
2023
relay logs (that is, there is no relay log with a format change
2024
except within the 3 first events, which mysqlbinlog handles
2025
gracefully). So this code should always be good.
2028
if (print_event_info->auto_increment_increment != auto_increment_increment ||
2029
print_event_info->auto_increment_offset != auto_increment_offset)
2031
my_b_printf(file,"SET @@session.auto_increment_increment=%lu, @@session.auto_increment_offset=%lu%s\n",
2032
auto_increment_increment,auto_increment_offset,
2033
print_event_info->delimiter);
2034
print_event_info->auto_increment_increment= auto_increment_increment;
2035
print_event_info->auto_increment_offset= auto_increment_offset;
2038
/* TODO: print the catalog when we feature SET CATALOG */
2040
if (likely(charset_inited) &&
2041
(unlikely(!print_event_info->charset_inited ||
2042
memcmp(print_event_info->charset, charset, 6))))
2044
const CHARSET_INFO * const cs_info= get_charset(uint2korr(charset), MYF(MY_WME));
2047
/* for mysql client */
2048
my_b_printf(file, "/*!\\C %s */%s\n",
2049
cs_info->csname, print_event_info->delimiter);
2051
my_b_printf(file,"SET "
2052
"@@session.character_set_client=%d,"
2053
"@@session.collation_connection=%d,"
2054
"@@session.collation_server=%d"
2057
uint2korr(charset+2),
2058
uint2korr(charset+4),
2059
print_event_info->delimiter);
2060
memcpy(print_event_info->charset, charset, 6);
2061
print_event_info->charset_inited= 1;
2065
if (memcmp(print_event_info->time_zone_str, time_zone_str, time_zone_len+1))
2067
my_b_printf(file,"SET @@session.time_zone='%s'%s\n",
2068
time_zone_str, print_event_info->delimiter);
2069
memcpy(print_event_info->time_zone_str, time_zone_str, time_zone_len+1);
2072
if (lc_time_names_number != print_event_info->lc_time_names_number)
2074
my_b_printf(file, "SET @@session.lc_time_names=%d%s\n",
2075
lc_time_names_number, print_event_info->delimiter);
2076
print_event_info->lc_time_names_number= lc_time_names_number;
2078
if (charset_database_number != print_event_info->charset_database_number)
2080
if (charset_database_number)
2081
my_b_printf(file, "SET @@session.collation_database=%d%s\n",
2082
charset_database_number, print_event_info->delimiter);
2084
my_b_printf(file, "SET @@session.collation_database=DEFAULT%s\n",
2085
print_event_info->delimiter);
2086
print_event_info->charset_database_number= charset_database_number;
2091
void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
2093
Write_on_release_cache cache(&print_event_info->head_cache, file);
2095
print_query_header(&cache, print_event_info);
2096
my_b_write(&cache, (uchar*) query, q_len);
2097
my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
2099
#endif /* DRIZZLE_CLIENT */
2103
1665
Query_log_event::do_apply_event()
2106
#if defined(HAVE_REPLICATION) && !defined(DRIZZLE_CLIENT)
2108
1667
int Query_log_event::do_apply_event(Relay_log_info const *rli)
2110
1669
return do_apply_event(rli, query, q_len);
2459
2013
pos= int10_to_str(binlog_version, pos, 10);
2460
2014
protocol->store(buf, (uint) (pos-buf), &my_charset_bin);
2466
Start_log_event_v3::print()
2469
#ifdef DRIZZLE_CLIENT
2470
void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
2472
Write_on_release_cache cache(&print_event_info->head_cache, file,
2473
Write_on_release_cache::FLUSH_F);
2475
if (!print_event_info->short_form)
2477
print_header(&cache, print_event_info, false);
2478
my_b_printf(&cache, "\tStart: binlog v %d, server v %s created ",
2479
binlog_version, server_version);
2480
print_timestamp(&cache);
2482
my_b_printf(&cache," at startup");
2483
my_b_printf(&cache, "\n");
2484
if (flags & LOG_EVENT_BINLOG_IN_USE_F)
2485
my_b_printf(&cache, "# Warning: this binlog was not closed properly. "
2486
"Most probably mysqld crashed writing it.\n");
2488
if (!artificial_event && created)
2490
#ifdef WHEN_WE_HAVE_THE_RESET_CONNECTION_SQL_COMMAND
2492
This is for mysqlbinlog: like in replication, we want to delete the stale
2493
tmp files left by an unclean shutdown of mysqld (temporary tables)
2494
and rollback unfinished transaction.
2495
Probably this can be done with RESET CONNECTION (syntax to be defined).
2497
my_b_printf(&cache,"RESET CONNECTION%s\n", print_event_info->delimiter);
2499
my_b_printf(&cache,"ROLLBACK%s\n", print_event_info->delimiter);
2503
print_event_info->base64_output_mode != BASE64_OUTPUT_NEVER &&
2504
!print_event_info->short_form)
2506
my_b_printf(&cache, "BINLOG '\n");
2507
print_base64(&cache, print_event_info, false);
2508
print_event_info->printed_fd_event= true;
2512
#endif /* DRIZZLE_CLIENT */
2515
2019
Start_log_event_v3::Start_log_event_v3()
3345
Load_log_event::print()
3348
#ifdef DRIZZLE_CLIENT
3349
void Load_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
3351
print(file, print_event_info, 0);
3355
void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info,
3358
Write_on_release_cache cache(&print_event_info->head_cache, file_arg);
3360
if (!print_event_info->short_form)
3362
print_header(&cache, print_event_info, false);
3363
my_b_printf(&cache, "\tQuery\tthread_id=%ld\texec_time=%ld\n",
3364
thread_id, exec_time);
3367
bool different_db= 1;
3371
If the database is different from the one of the previous statement, we
3372
need to print the "use" command, and we update the last_db.
3373
But if commented, the "use" is going to be commented so we should not
3376
if ((different_db= memcmp(print_event_info->db, db, db_len + 1)) &&
3378
memcpy(print_event_info->db, db, db_len + 1);
3381
if (db && db[0] && different_db)
3382
my_b_printf(&cache, "%suse %s%s\n",
3383
commented ? "# " : "",
3384
db, print_event_info->delimiter);
3386
if (flags & LOG_EVENT_THREAD_SPECIFIC_F)
3387
my_b_printf(&cache,"%sSET @@session.pseudo_thread_id=%lu%s\n",
3388
commented ? "# " : "", (ulong)thread_id,
3389
print_event_info->delimiter);
3390
my_b_printf(&cache, "%sLOAD DATA ",
3391
commented ? "# " : "");
3392
if (check_fname_outside_temp_buf())
3393
my_b_printf(&cache, "LOCAL ");
3394
my_b_printf(&cache, "INFILE '%-*s' ", fname_len, fname);
3396
if (sql_ex.opt_flags & REPLACE_FLAG)
3397
my_b_printf(&cache," REPLACE ");
3398
else if (sql_ex.opt_flags & IGNORE_FLAG)
3399
my_b_printf(&cache," IGNORE ");
3401
my_b_printf(&cache, "INTO Table `%s`", table_name);
3402
my_b_printf(&cache, " FIELDS TERMINATED BY ");
3403
pretty_print_str(&cache, sql_ex.field_term, sql_ex.field_term_len);
3405
if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG)
3406
my_b_printf(&cache," OPTIONALLY ");
3407
my_b_printf(&cache, " ENCLOSED BY ");
3408
pretty_print_str(&cache, sql_ex.enclosed, sql_ex.enclosed_len);
3410
my_b_printf(&cache, " ESCAPED BY ");
3411
pretty_print_str(&cache, sql_ex.escaped, sql_ex.escaped_len);
3413
my_b_printf(&cache," LINES TERMINATED BY ");
3414
pretty_print_str(&cache, sql_ex.line_term, sql_ex.line_term_len);
3417
if (sql_ex.line_start)
3419
my_b_printf(&cache," STARTING BY ");
3420
pretty_print_str(&cache, sql_ex.line_start, sql_ex.line_start_len);
3422
if ((long) skip_lines > 0)
3423
my_b_printf(&cache, " IGNORE %ld LINES", (long) skip_lines);
3428
const char* field = fields;
3429
my_b_printf(&cache, " (");
3430
for (i = 0; i < num_fields; i++)
3433
my_b_printf(&cache, ",");
3434
my_b_printf(&cache, field);
3436
field += field_lens[i] + 1;
3438
my_b_printf(&cache, ")");
3441
my_b_printf(&cache, "%s\n", print_event_info->delimiter);
3444
#endif /* DRIZZLE_CLIENT */
3446
#ifndef DRIZZLE_CLIENT
3449
2835
Load_log_event::set_fields()
4451
3707
my_b_safe_write(file, (uchar*) buf1, buf1_length) ||
4452
3708
my_b_safe_write(file, pos, val_len));
4458
User_var_log_event::print()
4461
#ifdef DRIZZLE_CLIENT
4462
void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
4464
Write_on_release_cache cache(&print_event_info->head_cache, file,
4465
Write_on_release_cache::FLUSH_F);
4467
if (!print_event_info->short_form)
4469
print_header(&cache, print_event_info, false);
4470
my_b_printf(&cache, "\tUser_var\n");
4473
my_b_printf(&cache, "SET @`");
4474
my_b_write(&cache, (uchar*) name, (uint) (name_len));
4475
my_b_printf(&cache, "`");
4479
my_b_printf(&cache, ":=NULL%s\n", print_event_info->delimiter);
4486
char real_buf[FMT_G_BUFSIZE(14)];
4487
float8get(real_val, val);
4488
sprintf(real_buf, "%.14g", real_val);
4489
my_b_printf(&cache, ":=%s%s\n", real_buf, print_event_info->delimiter);
4493
int64_t10_to_str(uint8korr(val), int_buf, -10);
4494
my_b_printf(&cache, ":=%s%s\n", int_buf, print_event_info->delimiter);
4496
case DECIMAL_RESULT:
4499
int str_len= sizeof(str_buf) - 1;
4500
int precision= (int)val[0];
4501
int scale= (int)val[1];
4502
decimal_digit_t dec_buf[10];
4507
bin2decimal((uchar*) val+2, &dec, precision, scale);
4508
decimal2string(&dec, str_buf, &str_len, 0, 0, 0);
4509
str_buf[str_len]= 0;
4510
my_b_printf(&cache, ":=%s%s\n", str_buf, print_event_info->delimiter);
4516
Let's express the string in hex. That's the most robust way. If we
4517
print it in character form instead, we need to escape it with
4518
character_set_client which we don't know (we will know it in 5.0, but
4519
in 4.1 we don't know it easily when we are printing
4520
User_var_log_event). Explanation why we would need to bother with
4521
character_set_client (quoting Bar):
4522
> Note, the parser doesn't switch to another unescaping mode after
4523
> it has met a character set introducer.
4524
> For example, if an SJIS client says something like:
4525
> SET @a= _ucs2 \0a\0b'
4526
> the string constant is still unescaped according to SJIS, not
4527
> according to UCS2.
4530
const CHARSET_INFO *cs;
4532
if (!(hex_str= (char *)my_alloca(2*val_len+1+2))) // 2 hex digits / byte
4533
break; // no error, as we are 'void'
4534
str_to_hex(hex_str, val, val_len);
4536
For proper behaviour when mysqlbinlog|mysql, we need to explicitely
4537
specify the variable's collation. It will however cause problems when
4538
people want to mysqlbinlog|mysql into another server not supporting the
4539
character set. But there's not much to do about this and it's unlikely.
4541
if (!(cs= get_charset(charset_number, MYF(0))))
4543
Generate an unusable command (=> syntax error) is probably the best
4544
thing we can do here.
4546
my_b_printf(&cache, ":=???%s\n", print_event_info->delimiter);
4548
my_b_printf(&cache, ":=_%s %s COLLATE `%s`%s\n",
4549
cs->csname, hex_str, cs->name,
4550
print_event_info->delimiter);
4565
3714
User_var_log_event::do_apply_event()
4568
#if defined(HAVE_REPLICATION) && !defined(DRIZZLE_CLIENT)
4569
3717
int User_var_log_event::do_apply_event(Relay_log_info const *rli)
5000
Create_file_log_event::print()
5003
#ifdef DRIZZLE_CLIENT
5004
void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info,
5007
Write_on_release_cache cache(&print_event_info->head_cache, file);
5009
if (print_event_info->short_form)
5011
if (enable_local && check_fname_outside_temp_buf())
5012
Load_log_event::print(file, print_event_info);
5018
Load_log_event::print(file, print_event_info,
5019
!check_fname_outside_temp_buf());
5021
That one is for "file_id: etc" below: in mysqlbinlog we want the #, in
5022
SHOW BINLOG EVENTS we don't.
5024
my_b_printf(&cache, "#");
5027
my_b_printf(&cache, " file_id: %d block_len: %d\n", file_id, block_len);
5031
void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
5033
print(file, print_event_info, 0);
5035
#endif /* DRIZZLE_CLIENT */
5039
4084
Create_file_log_event::pack_info()
5042
#if defined(HAVE_REPLICATION) && !defined(DRIZZLE_CLIENT)
5043
4087
void Create_file_log_event::pack_info(Protocol *protocol)
5045
4089
char buf[NAME_LEN*2 + 30 + 21*2], *pos;
5661
4618
*(buf + 4 + 4 + 4)= (uchar) dup_handling;
5662
4619
return my_b_safe_write(file, buf, EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN);
5667
#ifdef DRIZZLE_CLIENT
5668
void Execute_load_query_log_event::print(FILE* file,
5669
PRINT_EVENT_INFO* print_event_info)
5671
print(file, print_event_info, 0);
5675
Prints the query as LOAD DATA LOCAL and with rewritten filename.
5677
void Execute_load_query_log_event::print(FILE* file,
5678
PRINT_EVENT_INFO* print_event_info,
5679
const char *local_fname)
5681
Write_on_release_cache cache(&print_event_info->head_cache, file);
5683
print_query_header(&cache, print_event_info);
5687
my_b_write(&cache, (uchar*) query, fn_pos_start);
5688
my_b_printf(&cache, " LOCAL INFILE \'");
5689
my_b_printf(&cache, local_fname);
5690
my_b_printf(&cache, "\'");
5691
if (dup_handling == LOAD_DUP_REPLACE)
5692
my_b_printf(&cache, " REPLACE");
5693
my_b_printf(&cache, " INTO");
5694
my_b_write(&cache, (uchar*) query + fn_pos_end, q_len-fn_pos_end);
5695
my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
5699
my_b_write(&cache, (uchar*) query, q_len);
5700
my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
5703
if (!print_event_info->short_form)
5704
my_b_printf(&cache, "# file_id: %d \n", file_id);
5709
#if defined(HAVE_REPLICATION) && !defined(DRIZZLE_CLIENT)
5710
4623
void Execute_load_query_log_event::pack_info(Protocol *protocol)
5712
4625
char *buf, *pos;
8219
6993
set_if_smaller(ident_len,FN_REFLEN-1);
8220
6994
log_ident= buf + header_size;
8225
#ifdef DRIZZLE_CLIENT
8227
The default values for these variables should be values that are
8228
*incorrect*, i.e., values that cannot occur in an event. This way,
8229
they will always be printed for the first event.
8231
st_print_event_info::st_print_event_info()
8232
:flags2_inited(0), sql_mode_inited(0),
8233
auto_increment_increment(0),auto_increment_offset(0), charset_inited(0),
8234
lc_time_names_number(UINT32_MAX),
8235
charset_database_number(ILLEGAL_CHARSET_INFO_NUMBER),
8236
thread_id(0), thread_id_printed(false),
8237
base64_output_mode(BASE64_OUTPUT_UNSPEC), printed_fd_event(false)
8240
Currently we only use static PRINT_EVENT_INFO objects, so zeroed at
8241
program's startup, but these explicit memset() is for the day someone
8242
creates dynamic instances.
8244
memset(db, 0, sizeof(db));
8245
memset(charset, 0, sizeof(charset));
8246
memset(time_zone_str, 0, sizeof(time_zone_str));
8249
myf const flags = MYF(MY_WME | MY_NABP);
8250
open_cached_file(&head_cache, NULL, NULL, 0, flags);
8251
open_cached_file(&body_cache, NULL, NULL, 0, flags);