#include "client_priv.h"#include <my_time.h>#include "mysql_priv.h"#include "log_event.h"#include "sql_common.h"#include <help_start.h>#include <help_end.h>#include "my_decimal.h"#include "decimal.c"#include "my_decimal.cc"#include "log_event.cc"Include dependency graph for mysqlbinlog.cc:

Go to the source code of this file.
Classes | |
| class | Load_log_processor |
| struct | Load_log_processor::File_name_record |
Defines | |
| #define | MYSQL_CLIENT |
| #define | BIN_LOG_HEADER_SIZE 4 |
| #define | PROBE_HEADER_LEN (EVENT_LEN_OFFSET+4) |
| #define | CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES) |
| #define | start_position_mot ((my_off_t)start_position) |
| #define | stop_position_mot ((my_off_t)stop_position) |
Functions | |
| void | sql_print_error (const char *format,...) |
| static int | dump_local_log_entries (const char *logname) |
| static int | dump_remote_log_entries (const char *logname) |
| static int | dump_log_entries (const char *logname) |
| static int | dump_remote_file (NET *net, const char *fname) |
| static void | die (const char *fmt,...) |
| static MYSQL * | safe_connect () |
| static bool | check_database (const char *log_dbname) |
| int | process_event (PRINT_EVENT_INFO *print_event_info, Log_event *ev, my_off_t pos) |
| static void | cleanup () |
| static void | print_version () |
| static void | usage () |
| static my_time_t | convert_str_to_timestamp (const char *str) |
| my_bool | get_one_option (int optid, const struct my_option *opt __attribute__((unused)), char *argument) |
| static int | parse_args (int *argc, char ***argv) |
| static int | check_master_version (MYSQL *mysql, Format_description_log_event **description_event) |
| static void | check_header (IO_CACHE *file, Format_description_log_event **description_event) |
| int | main (int argc, char **argv) |
Variables | |
| char | server_version [SERVER_VERSION_LENGTH] |
| ulong | server_id = 0 |
| ulong | bytes_sent = 0L |
| ulong | bytes_received = 0L |
| ulong | mysqld_net_retry_count = 10L |
| ulong | open_files_limit |
| uint | test_flags = 0 |
| static uint | opt_protocol = 0 |
| static FILE * | result_file |
| static const char * | default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace" |
| static const char * | load_default_groups [] = { "mysqlbinlog","client",0 } |
| static bool | one_database = 0 |
| static bool | to_last_remote_log = 0 |
| static bool | disable_log_bin = 0 |
| static bool | opt_hexdump = 0 |
| static bool | opt_base64_output = 0 |
| static const char * | database = 0 |
| static my_bool | force_opt = 0 |
| static my_bool | short_form = 0 |
| static my_bool | remote_opt = 0 |
| static ulonglong | offset = 0 |
| static const char * | host = 0 |
| static int | port = 0 |
| static const char * | sock = 0 |
| static const char * | user = 0 |
| static char * | pass = 0 |
| static char * | charset = 0 |
| static ulonglong | start_position |
| static ulonglong | stop_position |
| static char * | start_datetime_str |
| static char * | stop_datetime_str |
| static my_time_t | start_datetime = 0 |
| static my_time_t | stop_datetime = MY_TIME_T_MAX |
| static ulonglong | rec_count = 0 |
| static short | binlog_flags = 0 |
| static MYSQL * | mysql = NULL |
| static const char * | dirname_for_local_load = 0 |
| static bool | stop_passed = 0 |
| Format_description_log_event * | description_event |
| Load_log_processor | load_processor |
| static struct my_option | my_long_options [] |
| #define BIN_LOG_HEADER_SIZE 4 |
Definition at line 41 of file mysqlbinlog.cc.
Referenced by check_header(), MYSQL_BIN_LOG::close(), dump_local_log_entries(), dump_remote_log_entries(), main(), and MYSQL_BIN_LOG::open().
| #define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES) |
| #define MYSQL_CLIENT |
Definition at line 32 of file mysqlbinlog.cc.
| #define PROBE_HEADER_LEN (EVENT_LEN_OFFSET+4) |
| #define start_position_mot ((my_off_t)start_position) |
Definition at line 79 of file mysqlbinlog.cc.
Referenced by dump_local_log_entries(), and dump_remote_log_entries().
| #define stop_position_mot ((my_off_t)stop_position) |
| static bool check_database | ( | const char * | log_dbname | ) | [static] |
Definition at line 471 of file mysqlbinlog.cc.
References database, NULL, one_database, and strcmp().
Referenced by process_event().
00472 { 00473 return one_database && 00474 (log_dbname != NULL) && 00475 strcmp(log_dbname, database); 00476 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void check_header | ( | IO_CACHE * | file, | |
| Format_description_log_event ** | description_event | |||
| ) | [static] |
Definition at line 1219 of file mysqlbinlog.cc.
References BIN_LOG_HEADER_SIZE, BINLOG_MAGIC, buf, DBUG_PRINT, description_event, die(), EVENT_LEN_OFFSET, FORMAT_DESCRIPTION_EVENT, LOG_EVENT_MINIMAL_HEADER_LEN, memcmp(), my_b_read, my_b_seek(), my_b_tell, pos(), PROBE_HEADER_LEN, Log_event::read_log_event(), ROTATE_EVENT, START_EVENT_V3, start_position, START_V3_HEADER_LEN, and uint4korr.
Referenced by az_open(), azread(), dump_local_log_entries(), gz_open(), and gzread().
01221 { 01222 byte header[BIN_LOG_HEADER_SIZE]; 01223 byte buf[PROBE_HEADER_LEN]; 01224 my_off_t tmp_pos, pos; 01225 01226 *description_event= new Format_description_log_event(3); 01227 pos= my_b_tell(file); 01228 my_b_seek(file, (my_off_t)0); 01229 if (my_b_read(file, header, sizeof(header))) 01230 die("Failed reading header; Probably an empty file"); 01231 if (memcmp(header, BINLOG_MAGIC, sizeof(header))) 01232 die("File is not a binary log file"); 01233 01234 /* 01235 Imagine we are running with --start-position=1000. We still need 01236 to know the binlog format's. So we still need to find, if there is 01237 one, the Format_desc event, or to know if this is a 3.23 01238 binlog. So we need to first read the first events of the log, 01239 those around offset 4. Even if we are reading a 3.23 binlog from 01240 the start (no --start-position): we need to know the header length 01241 (which is 13 in 3.23, 19 in 4.x) to be able to successfully print 01242 the first event (Start_log_event_v3). So even in this case, we 01243 need to "probe" the first bytes of the log *before* we do a real 01244 read_log_event(). Because read_log_event() needs to know the 01245 header's length to work fine. 01246 */ 01247 for(;;) 01248 { 01249 tmp_pos= my_b_tell(file); /* should be 4 the first time */ 01250 if (my_b_read(file, buf, sizeof(buf))) 01251 { 01252 if (file->error) 01253 die("\ 01254 Could not read entry at offset %lu : Error in log format or read error", 01255 tmp_pos); 01256 /* 01257 Otherwise this is just EOF : this log currently contains 0-2 01258 events. Maybe it's going to be filled in the next 01259 milliseconds; then we are going to have a problem if this a 01260 3.23 log (imagine we are locally reading a 3.23 binlog which 01261 is being written presently): we won't know it in 01262 read_log_event() and will fail(). Similar problems could 01263 happen with hot relay logs if --start-position is used (but a 01264 --start-position which is posterior to the current size of the log). 01265 These are rare problems anyway (reading a hot log + when we 01266 read the first events there are not all there yet + when we 01267 read a bit later there are more events + using a strange 01268 --start-position). 01269 */ 01270 break; 01271 } 01272 else 01273 { 01274 DBUG_PRINT("info",("buf[4]=%d", buf[4])); 01275 /* always test for a Start_v3, even if no --start-position */ 01276 if (buf[4] == START_EVENT_V3) /* This is 3.23 or 4.x */ 01277 { 01278 if (uint4korr(buf + EVENT_LEN_OFFSET) < 01279 (LOG_EVENT_MINIMAL_HEADER_LEN + START_V3_HEADER_LEN)) 01280 { 01281 /* This is 3.23 (format 1) */ 01282 delete *description_event; 01283 *description_event= new Format_description_log_event(1); 01284 } 01285 break; 01286 } 01287 else if (tmp_pos >= start_position) 01288 break; 01289 else if (buf[4] == FORMAT_DESCRIPTION_EVENT) /* This is 5.0 */ 01290 { 01291 my_b_seek(file, tmp_pos); /* seek back to event's start */ 01292 if (!(*description_event= (Format_description_log_event*) 01293 Log_event::read_log_event(file, *description_event))) 01294 /* EOF can't be hit here normally, so it's a real error */ 01295 die("Could not read a Format_description_log_event event \ 01296 at offset %lu ; this could be a log format error or read error", 01297 tmp_pos); 01298 DBUG_PRINT("info",("Setting description_event")); 01299 } 01300 else if (buf[4] == ROTATE_EVENT) 01301 { 01302 Log_event *ev; 01303 my_b_seek(file, tmp_pos); /* seek back to event's start */ 01304 if (!(ev= Log_event::read_log_event(file, *description_event))) 01305 /* EOF can't be hit here normally, so it's a real error */ 01306 die("Could not read a Rotate_log_event event at offset %lu ;" 01307 " this could be a log format error or read error", tmp_pos); 01308 delete ev; 01309 } 01310 else 01311 break; 01312 } 01313 } 01314 my_b_seek(file, pos); 01315 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static int check_master_version | ( | MYSQL * | mysql, | |
| Format_description_log_event ** | description_event | |||
| ) | [static] |
Definition at line 989 of file mysqlbinlog.cc.
References description_event, die(), mysql, mysql_close(), mysql_error(), mysql_fetch_row(), mysql_free_result(), mysql_query(), mysql_store_result(), sql_print_error(), strmake(), and version().
Referenced by dump_remote_log_entries().
00992 { 00993 MYSQL_RES* res = 0; 00994 MYSQL_ROW row; 00995 const char* version; 00996 00997 if (mysql_query(mysql, "SELECT VERSION()") || 00998 !(res = mysql_store_result(mysql))) 00999 { 01000 char errmsg[256]; 01001 strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1); 01002 mysql_close(mysql); 01003 die("Error checking master version: %s", errmsg); 01004 } 01005 if (!(row = mysql_fetch_row(res))) 01006 { 01007 mysql_free_result(res); 01008 mysql_close(mysql); 01009 die("Master returned no rows for SELECT VERSION()"); 01010 return 1; 01011 } 01012 if (!(version = row[0])) 01013 { 01014 mysql_free_result(res); 01015 mysql_close(mysql); 01016 die("Master reported NULL for the version"); 01017 } 01018 01019 switch (*version) { 01020 case '3': 01021 *description_event= new Format_description_log_event(1); 01022 break; 01023 case '4': 01024 *description_event= new Format_description_log_event(3); 01025 case '5': 01026 /* 01027 The server is soon going to send us its Format_description log 01028 event, unless it is a 5.0 server with 3.23 or 4.0 binlogs. 01029 So we first assume that this is 4.0 (which is enough to read the 01030 Format_desc event if one comes). 01031 */ 01032 *description_event= new Format_description_log_event(3); 01033 break; 01034 default: 01035 sql_print_error("Master reported unrecognized MySQL version '%s'", 01036 version); 01037 mysql_free_result(res); 01038 mysql_close(mysql); 01039 return 1; 01040 } 01041 mysql_free_result(res); 01042 return 0; 01043 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void cleanup | ( | ) | [static] |
Definition at line 805 of file mysqlbinlog.cc.
References database, dirname_for_local_load, host, MY_ALLOW_ZERO_PTR, my_free, MYF, pass, and user.
Referenced by btr_search_drop_page_hash_index(), die(), main(), mysql_delete(), and primary_key_fields().
00806 { 00807 my_free(pass,MYF(MY_ALLOW_ZERO_PTR)); 00808 my_free((char*) database, MYF(MY_ALLOW_ZERO_PTR)); 00809 my_free((char*) host, MYF(MY_ALLOW_ZERO_PTR)); 00810 my_free((char*) user, MYF(MY_ALLOW_ZERO_PTR)); 00811 my_free((char*) dirname_for_local_load, MYF(MY_ALLOW_ZERO_PTR)); 00812 }
Here is the caller graph for this function:

| static my_time_t convert_str_to_timestamp | ( | const char * | str | ) | [static] |
Definition at line 853 of file mysqlbinlog.cc.
References exit, my_system_gmt_sec(), MYSQL_TIMESTAMP_DATETIME, str_to_datetime(), and strlen().
Referenced by get_one_option().
00854 { 00855 int was_cut; 00856 MYSQL_TIME l_time; 00857 long dummy_my_timezone; 00858 my_bool dummy_in_dst_time_gap; 00859 /* We require a total specification (date AND time) */ 00860 if (str_to_datetime(str, strlen(str), &l_time, 0, &was_cut) != 00861 MYSQL_TIMESTAMP_DATETIME || was_cut) 00862 { 00863 fprintf(stderr, "Incorrect date and time argument: %s\n", str); 00864 exit(1); 00865 } 00866 /* 00867 Note that Feb 30th, Apr 31st cause no error messages and are mapped to 00868 the next existing day, like in mysqld. Maybe this could be changed when 00869 mysqld is changed too (with its "strict" mode?). 00870 */ 00871 return 00872 my_system_gmt_sec(&l_time, &dummy_my_timezone, &dummy_in_dst_time_gap); 00873 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void die | ( | const char * | fmt, | |
| ... | ||||
| ) | [static] |
Definition at line 814 of file mysqlbinlog.cc.
References args, cleanup(), exit, MY_DONT_FREE_DBUG, and my_end().
Referenced by angel(), append_stmt_result(), append_warnings(), check_eol_junk(), check_header(), check_master_version(), check_regerr(), check_result(), close_connection(), daemonize(), do_block(), do_connect(), do_done(), do_eval(), do_exec(), do_let(), do_modify_var(), do_rpl_probe(), do_save_master_pos(), do_sleep(), do_source(), do_sync_with_master(), do_sync_with_master2(), do_system(), do_wait_for_slave_to_stop(), dump_local_log_entries(), dyn_string_cmp(), eval_expr(), get_errcodes(), get_file_name(), get_one_option(), get_query_type(), get_replace(), get_replace_column(), get_replace_regex(), get_string(), handle_error(), handle_no_error(), init_order(), init_re_comp(), init_replace_regex(), init_sym_table(), init_var_hash(), main(), match_re(), open_file(), open_files(), permute(), read_line(), read_query(), run_query(), run_query_stmt(), safe_connect(), safe_get_param(), safe_net_read(), safe_query(), select_connection(), select_connection_name(), set_charset(), str_to_file(), util_query(), var_copy(), var_get(), var_init(), var_query_set(), var_set(), and verify_sort().
00815 { 00816 va_list args; 00817 va_start(args, fmt); 00818 fprintf(stderr, "ERROR: "); 00819 vfprintf(stderr, fmt, args); 00820 fprintf(stderr, "\n"); 00821 va_end(args); 00822 cleanup(); 00823 /* We cannot free DBUG, it is used in global destructors after exit(). */ 00824 my_end(MY_DONT_FREE_DBUG); 00825 exit(1); 00826 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static int dump_local_log_entries | ( | const char * | logname | ) | [static] |
Definition at line 1318 of file mysqlbinlog.cc.
References BIN_LOG_HEADER_SIZE, check_header(), description_event, die(), end_io_cache(), st_io_cache::error, error, Log_event::flags, init_io_cache(), IO_SIZE, Format_description_log_event::is_valid(), llstr(), LOG_EVENT_BINLOG_IN_USE_F, min, my_b_read, my_b_tell, my_close(), MY_DONT_CHECK_FILESIZE, MY_NABP, my_open(), MY_WME, MYF, O_BINARY, process_event(), READ_CACHE, Log_event::read_log_event(), start_position, and start_position_mot.
Referenced by dump_log_entries().
01319 { 01320 File fd = -1; 01321 IO_CACHE cache,*file= &cache; 01322 PRINT_EVENT_INFO print_event_info; 01323 byte tmp_buff[BIN_LOG_HEADER_SIZE]; 01324 int error= 0; 01325 01326 if (logname && logname[0] != '-') 01327 { 01328 if ((fd = my_open(logname, O_RDONLY | O_BINARY, MYF(MY_WME))) < 0) 01329 return 1; 01330 if (init_io_cache(file, fd, 0, READ_CACHE, start_position_mot, 0, 01331 MYF(MY_WME | MY_NABP))) 01332 { 01333 my_close(fd, MYF(MY_WME)); 01334 return 1; 01335 } 01336 check_header(file, &description_event); 01337 } 01338 else // reading from stdin; 01339 { 01340 if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0, 01341 0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE))) 01342 return 1; 01343 check_header(file, &description_event); 01344 if (start_position) 01345 { 01346 /* skip 'start_position' characters from stdin */ 01347 byte buff[IO_SIZE]; 01348 my_off_t length,tmp; 01349 for (length= start_position_mot ; length > 0 ; length-=tmp) 01350 { 01351 tmp=min(length,sizeof(buff)); 01352 if (my_b_read(file, buff, (uint) tmp)) 01353 { 01354 error= 1; 01355 goto end; 01356 } 01357 } 01358 } 01359 } 01360 01361 if (!description_event || !description_event->is_valid()) 01362 die("Invalid Format_description log event; could be out of memory"); 01363 01364 if (!start_position && my_b_read(file, tmp_buff, BIN_LOG_HEADER_SIZE)) 01365 { 01366 error= 1; 01367 goto end; 01368 } 01369 for (;;) 01370 { 01371 char llbuff[21]; 01372 my_off_t old_off = my_b_tell(file); 01373 01374 Log_event* ev = Log_event::read_log_event(file, description_event); 01375 if (!ev) 01376 { 01377 /* 01378 if binlog wasn't closed properly ("in use" flag is set) don't complain 01379 about a corruption, but treat it as EOF and move to the next binlog. 01380 */ 01381 if (description_event->flags & LOG_EVENT_BINLOG_IN_USE_F) 01382 file->error= 0; 01383 else if (file->error) 01384 { 01385 fprintf(stderr, 01386 "Could not read entry at offset %s:" 01387 "Error in log format or read error\n", 01388 llstr(old_off,llbuff)); 01389 error= 1; 01390 } 01391 // file->error == 0 means EOF, that's OK, we break in this case 01392 break; 01393 } 01394 if ((error= process_event(&print_event_info, ev, old_off))) 01395 { 01396 if (error < 0) 01397 error= 0; 01398 break; 01399 } 01400 } 01401 01402 end: 01403 if (fd >= 0) 01404 my_close(fd, MYF(MY_WME)); 01405 end_io_cache(file); 01406 delete description_event; 01407 return error; 01408 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static int dump_log_entries | ( | const char * | logname | ) | [static] |
Definition at line 978 of file mysqlbinlog.cc.
References dump_local_log_entries(), dump_remote_log_entries(), and remote_opt.
Referenced by main().
00979 { 00980 return (remote_opt ? dump_remote_log_entries(logname) : 00981 dump_local_log_entries(logname)); 00982 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static int dump_remote_file | ( | NET * | net, | |
| const char * | fname | |||
| ) | [static] |
| static int dump_remote_log_entries | ( | const char * | logname | ) | [static] |
Definition at line 1046 of file mysqlbinlog.cc.
References BIN_LOG_HEADER_SIZE, binlog_flags, Start_log_event_v3::binlog_version, buf, check_master_version(), cli_safe_read(), COM_BINLOG_DUMP, CREATE_FILE_EVENT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, description_event, err, error, FN_REFLEN, Load_log_event::fname, Load_log_event::fname_len, Log_event::get_type_code(), Rotate_log_event::ident_len, int2store, int4store, Format_description_log_event::is_valid(), LOAD_EVENT, Load_log_processor::load_old_format_file(), load_processor, memcmp(), memcpy, my_close(), MY_WME, MYF, mysql, mysql_close(), mysql_error(), st_mysql::net, Rotate_log_event::new_log_ident, packet_error, Load_log_processor::prepare_new_file_for_old_format(), process_event(), Log_event::read_log_event(), st_net::read_pos, ROTATE_EVENT, safe_connect(), simple_command, start_position, start_position_mot, strlen(), to_last_remote_log, and Log_event::when.
Referenced by dump_log_entries().
01048 { 01049 char buf[128]; 01050 PRINT_EVENT_INFO print_event_info; 01051 ulong len; 01052 uint logname_len; 01053 NET* net; 01054 int error= 0; 01055 my_off_t old_off= start_position_mot; 01056 char fname[FN_REFLEN+1]; 01057 DBUG_ENTER("dump_remote_log_entries"); 01058 01059 /* 01060 Even if we already read one binlog (case of >=2 binlogs on command line), 01061 we cannot re-use the same connection as before, because it is now dead 01062 (COM_BINLOG_DUMP kills the thread when it finishes). 01063 */ 01064 mysql= safe_connect(); 01065 net= &mysql->net; 01066 01067 if (check_master_version(mysql, &description_event)) 01068 { 01069 fprintf(stderr, "Could not find server version"); 01070 DBUG_RETURN(1); 01071 } 01072 if (!description_event || !description_event->is_valid()) 01073 { 01074 fprintf(stderr, "Invalid Format_description log event; \ 01075 could be out of memory"); 01076 DBUG_RETURN(1); 01077 } 01078 01079 /* 01080 COM_BINLOG_DUMP accepts only 4 bytes for the position, so we are forced to 01081 cast to uint32. 01082 */ 01083 int4store(buf, (uint32)start_position); 01084 int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags); 01085 01086 size_s tlen = strlen(logname); 01087 if (tlen > UINT_MAX) 01088 { 01089 fprintf(stderr,"Log name too long\n"); 01090 error= 1; 01091 goto err; 01092 } 01093 logname_len = (uint) tlen; 01094 int4store(buf + 6, 0); 01095 memcpy(buf + 10, logname, logname_len); 01096 if (simple_command(mysql, COM_BINLOG_DUMP, buf, logname_len + 10, 1)) 01097 { 01098 fprintf(stderr,"Got fatal error sending the log dump command\n"); 01099 error= 1; 01100 goto err; 01101 } 01102 01103 for (;;) 01104 { 01105 const char *error_msg; 01106 Log_event *ev; 01107 01108 len= cli_safe_read(mysql); 01109 if (len == packet_error) 01110 { 01111 fprintf(stderr, "Got error reading packet from server: %s\n", 01112 mysql_error(mysql)); 01113 error= 1; 01114 goto err; 01115 } 01116 if (len < 8 && net->read_pos[0] == 254) 01117 break; // end of data 01118 DBUG_PRINT("info",( "len= %u, net->read_pos[5] = %d\n", 01119 len, net->read_pos[5])); 01120 if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 , 01121 len - 1, &error_msg, 01122 description_event))) 01123 { 01124 fprintf(stderr, "Could not construct log event object\n"); 01125 error= 1; 01126 goto err; 01127 } 01128 01129 Log_event_type type= ev->get_type_code(); 01130 if (description_event->binlog_version >= 3 || 01131 (type != LOAD_EVENT && type != CREATE_FILE_EVENT)) 01132 { 01133 /* 01134 If this is a Rotate event, maybe it's the end of the requested binlog; 01135 in this case we are done (stop transfer). 01136 This is suitable for binlogs, not relay logs (but for now we don't read 01137 relay logs remotely because the server is not able to do that). If one 01138 day we read relay logs remotely, then we will have a problem with the 01139 detection below: relay logs contain Rotate events which are about the 01140 binlogs, so which would trigger the end-detection below. 01141 */ 01142 if (type == ROTATE_EVENT) 01143 { 01144 Rotate_log_event *rev= (Rotate_log_event *)ev; 01145 /* 01146 If this is a fake Rotate event, and not about our log, we can stop 01147 transfer. If this a real Rotate event (so it's not about our log, 01148 it's in our log describing the next log), we print it (because it's 01149 part of our log) and then we will stop when we receive the fake one 01150 soon. 01151 */ 01152 if (rev->when == 0) 01153 { 01154 if (!to_last_remote_log) 01155 { 01156 if ((rev->ident_len != logname_len) || 01157 memcmp(rev->new_log_ident, logname, logname_len)) 01158 { 01159 error= 0; 01160 goto err; 01161 } 01162 /* 01163 Otherwise, this is a fake Rotate for our log, at the very 01164 beginning for sure. Skip it, because it was not in the original 01165 log. If we are running with to_last_remote_log, we print it, 01166 because it serves as a useful marker between binlogs then. 01167 */ 01168 continue; 01169 } 01170 len= 1; // fake Rotate, so don't increment old_off 01171 } 01172 } 01173 if ((error= process_event(&print_event_info, ev, old_off))) 01174 { 01175 error= ((error < 0) ? 0 : 1); 01176 goto err; 01177 } 01178 } 01179 else 01180 { 01181 Load_log_event *le= (Load_log_event*)ev; 01182 const char *old_fname= le->fname; 01183 uint old_len= le->fname_len; 01184 File file; 01185 01186 if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0) 01187 { 01188 error= 1; 01189 goto err; 01190 } 01191 01192 if ((error= process_event(&print_event_info, ev, old_off))) 01193 { 01194 my_close(file,MYF(MY_WME)); 01195 error= ((error < 0) ? 0 : 1); 01196 goto err; 01197 } 01198 error= load_processor.load_old_format_file(net,old_fname,old_len,file); 01199 my_close(file,MYF(MY_WME)); 01200 if (error) 01201 { 01202 error= 1; 01203 goto err; 01204 } 01205 } 01206 /* 01207 Let's adjust offset for remote log as for local log to produce 01208 similar text. 01209 */ 01210 old_off+= len-1; 01211 } 01212 01213 err: 01214 mysql_close(mysql); 01215 DBUG_RETURN(error); 01216 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool get_one_option | ( | int | optid, | |
| const struct my_option *opt | __attribute__((unused)), | |||
| char * | argument | |||
| ) |
Definition at line 878 of file mysqlbinlog.cc.
References convert_str_to_timestamp(), DBUG_PUSH, default_dbug_option, exit, find_type(), get_tty_password(), MY_ALLOW_ZERO_PTR, MY_FAE, my_fopen(), my_free, my_strdup(), MY_WME, MYF, NullS, O_BINARY, one_database, OPT_AUTO_CLOSE, OPT_MYSQL_PROTOCOL, opt_protocol, OPT_START_DATETIME, OPT_STOP_DATETIME, pass, print_version(), remote_opt, result_file, sql_protocol_typelib, start(), start_datetime, start_datetime_str, stop_datetime, stop_datetime_str, tty_password, and usage().
00880 { 00881 bool tty_password=0; 00882 switch (optid) { 00883 #ifdef __NETWARE__ 00884 case OPT_AUTO_CLOSE: 00885 setscreenmode(SCR_AUTOCLOSE_ON_EXIT); 00886 break; 00887 #endif 00888 #ifndef DBUG_OFF 00889 case '#': 00890 DBUG_PUSH(argument ? argument : default_dbug_option); 00891 break; 00892 #endif 00893 case 'd': 00894 one_database = 1; 00895 break; 00896 case 'p': 00897 if (argument) 00898 { 00899 my_free(pass,MYF(MY_ALLOW_ZERO_PTR)); 00900 char *start=argument; 00901 pass= my_strdup(argument,MYF(MY_FAE)); 00902 while (*argument) *argument++= 'x'; /* Destroy argument */ 00903 if (*start) 00904 start[1]=0; /* Cut length of argument */ 00905 } 00906 else 00907 tty_password=1; 00908 break; 00909 case 'r': 00910 if (!(result_file = my_fopen(argument, O_WRONLY | O_BINARY, MYF(MY_WME)))) 00911 exit(1); 00912 break; 00913 case 'R': 00914 remote_opt= 1; 00915 break; 00916 case OPT_MYSQL_PROTOCOL: 00917 { 00918 if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) 00919 { 00920 fprintf(stderr, "Unknown option to protocol: %s\n", argument); 00921 exit(1); 00922 } 00923 break; 00924 } 00925 case OPT_START_DATETIME: 00926 start_datetime= convert_str_to_timestamp(start_datetime_str); 00927 break; 00928 case OPT_STOP_DATETIME: 00929 stop_datetime= convert_str_to_timestamp(stop_datetime_str); 00930 break; 00931 case 'V': 00932 print_version(); 00933 exit(0); 00934 case '?': 00935 usage(); 00936 exit(0); 00937 } 00938 if (tty_password) 00939 pass= get_tty_password(NullS); 00940 00941 return 0; 00942 }
Here is the call graph for this function:

| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 1411 of file mysqlbinlog.cc.
References BIN_LOG_HEADER_SIZE, charset, cleanup(), DBUG_ENTER, DBUG_PROCESS, DBUG_RETURN, defaults_argv, dirname_for_local_load, disable_log_bin, dump_log_entries(), exit, free_defaults(), free_tmpdir(), Load_log_processor::init(), Load_log_processor::init_by_cur_dir(), Load_log_processor::init_by_dir_name(), init_time(), init_tmpdir(), st_my_tmpdir::list, load_processor, MY_DONT_FREE_DBUG, my_end(), my_fclose(), my_free_open_file_info(), MY_INIT, my_set_max_open_files(), my_strdup(), my_tmpdir(), MY_WME, MYF, open_files_limit, parse_args(), result_file, start_position, stop_passed, stop_position, and usage().
01412 { 01413 static char **defaults_argv; 01414 int exit_value= 0; 01415 ulonglong save_stop_position; 01416 MY_INIT(argv[0]); 01417 DBUG_ENTER("main"); 01418 DBUG_PROCESS(argv[0]); 01419 01420 init_time(); // for time functions 01421 01422 parse_args(&argc, (char***)&argv); 01423 defaults_argv=argv; 01424 01425 if (!argc) 01426 { 01427 usage(); 01428 free_defaults(defaults_argv); 01429 exit(1); 01430 } 01431 01432 my_set_max_open_files(open_files_limit); 01433 01434 MY_TMPDIR tmpdir; 01435 tmpdir.list= 0; 01436 if (!dirname_for_local_load) 01437 { 01438 if (init_tmpdir(&tmpdir, 0)) 01439 exit(1); 01440 dirname_for_local_load= my_strdup(my_tmpdir(&tmpdir), MY_WME); 01441 } 01442 01443 if (load_processor.init()) 01444 exit(1); 01445 if (dirname_for_local_load) 01446 load_processor.init_by_dir_name(dirname_for_local_load); 01447 else 01448 load_processor.init_by_cur_dir(); 01449 01450 fprintf(result_file, 01451 "/*!40019 SET @@session.max_insert_delayed_threads=0*/;\n"); 01452 01453 if (disable_log_bin) 01454 fprintf(result_file, 01455 "/*!32316 SET @OLD_SQL_LOG_BIN=@@SQL_LOG_BIN, SQL_LOG_BIN=0*/;\n"); 01456 01457 /* 01458 In mysqlbinlog|mysql, don't want mysql to be disconnected after each 01459 transaction (which would be the case with GLOBAL.COMPLETION_TYPE==2). 01460 */ 01461 fprintf(result_file, 01462 "/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE," 01463 "COMPLETION_TYPE=0*/;\n"); 01464 01465 if (charset) 01466 fprintf(result_file, 01467 "\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;" 01468 "\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;" 01469 "\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;" 01470 "\n/*!40101 SET NAMES %s */;\n", charset); 01471 01472 for (save_stop_position= stop_position, stop_position= ~(my_off_t)0 ; 01473 (--argc >= 0) && !stop_passed ; ) 01474 { 01475 if (argc == 0) // last log, --stop-position applies 01476 stop_position= save_stop_position; 01477 if (dump_log_entries(*(argv++))) 01478 { 01479 exit_value=1; 01480 break; 01481 } 01482 // For next log, --start-position does not apply 01483 start_position= BIN_LOG_HEADER_SIZE; 01484 } 01485 01486 /* 01487 Issue a ROLLBACK in case the last printed binlog was crashed and had half 01488 of transaction. 01489 */ 01490 fprintf(result_file, 01491 "# End of log file\nROLLBACK /* added by mysqlbinlog */;\n" 01492 "/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;\n"); 01493 if (disable_log_bin) 01494 fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n"); 01495 01496 if (charset) 01497 fprintf(result_file, 01498 "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n" 01499 "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" 01500 "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); 01501 01502 if (tmpdir.list) 01503 free_tmpdir(&tmpdir); 01504 if (result_file != stdout) 01505 my_fclose(result_file, MYF(0)); 01506 cleanup(); 01507 free_defaults(defaults_argv); 01508 my_free_open_file_info(); 01509 /* We cannot free DBUG, it is used in global destructors after exit(). */ 01510 my_end(MY_DONT_FREE_DBUG); 01511 exit(exit_value); 01512 DBUG_RETURN(exit_value); // Keep compilers happy 01513 }
Here is the call graph for this function:

| static int parse_args | ( | int * | argc, | |
| char *** | argv | |||
| ) | [static] |
Definition at line 945 of file mysqlbinlog.cc.
References exit, get_one_option(), handle_options(), load_default_groups, load_defaults(), my_long_options, and result_file.
Referenced by main().
00946 { 00947 int ho_error; 00948 00949 result_file = stdout; 00950 load_defaults("my",load_default_groups,argc,argv); 00951 if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) 00952 exit(ho_error); 00953 00954 return 0; 00955 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void print_version | ( | void | ) | [static] |
Definition at line 830 of file mysqlbinlog.cc.
References MACHINE_TYPE, my_progname, NETWARE_SET_SCREEN_MODE, and SYSTEM_TYPE.
00831 { 00832 printf("%s Ver 3.1 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); 00833 NETWARE_SET_SCREEN_MODE(1); 00834 }
Definition at line 496 of file mysqlbinlog.cc.
References APPEND_BLOCK_EVENT, BEGIN_LOAD_QUERY_EVENT, Start_log_event_v3::binlog_version, check_database(), Format_description_log_event::common_header_len, CREATE_FILE_EVENT, Query_log_event::db, Load_log_event::db, db, DBUG_ENTER, DBUG_RETURN, description_event, EXEC_LOAD_EVENT, EXECUTE_LOAD_QUERY_EVENT, Execute_load_query_log_event::file_id, Execute_load_log_event::file_id, Load_log_event::fname, FORMAT_DESCRIPTION_EVENT, Log_event::get_type_code(), Load_log_processor::grab_event(), Load_log_processor::grab_fname(), llstr(), load_processor, my_free, MY_WME, MYF, offset, opt_base64_output, opt_hexdump, Load_log_processor::process(), QUERY_EVENT, rec_count, result_file, Log_event::server_id, server_id, short_form, start_datetime, stop_datetime, stop_passed, stop_position_mot, TRUE, and Log_event::when.
Referenced by dump_local_log_entries(), and dump_remote_log_entries().
00498 { 00499 char ll_buff[21]; 00500 Log_event_type ev_type= ev->get_type_code(); 00501 DBUG_ENTER("process_event"); 00502 print_event_info->short_form= short_form; 00503 00504 /* 00505 Format events are not concerned by --offset and such, we always need to 00506 read them to be able to process the wanted events. 00507 */ 00508 if ((rec_count >= offset) && 00509 ((my_time_t)(ev->when) >= start_datetime) || 00510 (ev_type == FORMAT_DESCRIPTION_EVENT)) 00511 { 00512 if (ev_type != FORMAT_DESCRIPTION_EVENT) 00513 { 00514 /* 00515 We have found an event after start_datetime, from now on print 00516 everything (in case the binlog has timestamps increasing and 00517 decreasing, we do this to avoid cutting the middle). 00518 */ 00519 start_datetime= 0; 00520 offset= 0; // print everything and protect against cycling rec_count 00521 } 00522 if (server_id && (server_id != ev->server_id)) { 00523 DBUG_RETURN(0); 00524 } 00525 if (((my_time_t)(ev->when) >= stop_datetime) 00526 || (pos >= stop_position_mot)) 00527 { 00528 stop_passed= 1; // skip all next binlogs 00529 DBUG_RETURN(-1); 00530 } 00531 if (!short_form) 00532 fprintf(result_file, "# at %s\n",llstr(pos,ll_buff)); 00533 00534 if (!opt_hexdump) 00535 print_event_info->hexdump_from= 0; /* Disabled */ 00536 else 00537 print_event_info->hexdump_from= pos; 00538 00539 print_event_info->base64_output= opt_base64_output; 00540 00541 switch (ev_type) { 00542 case QUERY_EVENT: 00543 if (check_database(((Query_log_event*)ev)->db)) 00544 goto end; 00545 if (opt_base64_output) 00546 { 00547 ev->print_header(result_file, print_event_info); 00548 ev->print_base64(result_file, print_event_info); 00549 } 00550 else 00551 ev->print(result_file, print_event_info); 00552 break; 00553 case CREATE_FILE_EVENT: 00554 { 00555 Create_file_log_event* ce= (Create_file_log_event*)ev; 00556 /* 00557 We test if this event has to be ignored. If yes, we don't save 00558 this event; this will have the good side-effect of ignoring all 00559 related Append_block and Exec_load. 00560 Note that Load event from 3.23 is not tested. 00561 */ 00562 if (check_database(ce->db)) 00563 goto end; // Next event 00564 /* 00565 We print the event, but with a leading '#': this is just to inform 00566 the user of the original command; the command we want to execute 00567 will be a derivation of this original command (we will change the 00568 filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT' 00569 below. 00570 */ 00571 if (opt_base64_output) 00572 { 00573 ce->print_header(result_file, print_event_info); 00574 ce->print_base64(result_file, print_event_info); 00575 } 00576 else 00577 ce->print(result_file, print_event_info, TRUE); 00578 00579 // If this binlog is not 3.23 ; why this test?? 00580 if (description_event->binlog_version >= 3) 00581 { 00582 if (load_processor.process(ce)) 00583 break; // Error 00584 ev= 0; 00585 } 00586 break; 00587 } 00588 case APPEND_BLOCK_EVENT: 00589 ev->print(result_file, print_event_info); 00590 if (load_processor.process((Append_block_log_event*) ev)) 00591 break; // Error 00592 break; 00593 case EXEC_LOAD_EVENT: 00594 { 00595 ev->print(result_file, print_event_info); 00596 Execute_load_log_event *exv= (Execute_load_log_event*)ev; 00597 Create_file_log_event *ce= load_processor.grab_event(exv->file_id); 00598 /* 00599 if ce is 0, it probably means that we have not seen the Create_file 00600 event (a bad binlog, or most probably --start-position is after the 00601 Create_file event). Print a warning comment. 00602 */ 00603 if (ce) 00604 { 00605 ce->print(result_file, print_event_info, TRUE); 00606 my_free((char*)ce->fname,MYF(MY_WME)); 00607 delete ce; 00608 } 00609 else 00610 fprintf(stderr,"Warning: ignoring Exec_load as there is no \ 00611 Create_file event for file_id: %u\n",exv->file_id); 00612 break; 00613 } 00614 case FORMAT_DESCRIPTION_EVENT: 00615 delete description_event; 00616 description_event= (Format_description_log_event*) ev; 00617 print_event_info->common_header_len= description_event->common_header_len; 00618 ev->print(result_file, print_event_info); 00619 /* 00620 We don't want this event to be deleted now, so let's hide it (I 00621 (Guilhem) should later see if this triggers a non-serious Valgrind 00622 error). Not serious error, because we will free description_event 00623 later. 00624 */ 00625 ev= 0; 00626 break; 00627 case BEGIN_LOAD_QUERY_EVENT: 00628 ev->print(result_file, print_event_info); 00629 load_processor.process((Begin_load_query_log_event*) ev); 00630 break; 00631 case EXECUTE_LOAD_QUERY_EVENT: 00632 { 00633 Execute_load_query_log_event *exlq= (Execute_load_query_log_event*)ev; 00634 char *fname= load_processor.grab_fname(exlq->file_id); 00635 00636 if (check_database(exlq->db)) 00637 { 00638 if (fname) 00639 my_free(fname, MYF(MY_WME)); 00640 goto end; 00641 } 00642 00643 if (fname) 00644 { 00645 exlq->print(result_file, print_event_info, fname); 00646 my_free(fname, MYF(MY_WME)); 00647 } 00648 else 00649 fprintf(stderr,"Warning: ignoring Execute_load_query as there is no \ 00650 Begin_load_query event for file_id: %u\n", exlq->file_id); 00651 break; 00652 } 00653 default: 00654 ev->print(result_file, print_event_info); 00655 } 00656 } 00657 00658 end: 00659 rec_count++; 00660 if (ev) 00661 delete ev; 00662 DBUG_RETURN(0); 00663 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static MYSQL * safe_connect | ( | ) | [static] |
Definition at line 957 of file mysqlbinlog.cc.
References die(), host, mysql_close(), mysql_error(), mysql_init(), MYSQL_OPT_PROTOCOL, mysql_options(), mysql_real_connect(), NULL, opt_protocol, pass, port, sock, strmake(), and user.
Referenced by do_connect(), dump_remote_log_entries(), main(), and util_query().
00958 { 00959 MYSQL *local_mysql= mysql_init(NULL); 00960 00961 if (!local_mysql) 00962 die("Failed on mysql_init"); 00963 00964 if (opt_protocol) 00965 mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); 00966 if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0)) 00967 { 00968 char errmsg[256]; 00969 strmake(errmsg, mysql_error(local_mysql), sizeof(errmsg)-1); 00970 mysql_close(local_mysql); 00971 die("failed on connect: %s", errmsg); 00972 } 00973 local_mysql->reconnect= 1; 00974 return local_mysql; 00975 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void sql_print_error | ( | const char * | format, | |
| ... | ||||
| ) |
Definition at line 3984 of file log.cc.
03985 { 03986 va_list args; 03987 DBUG_ENTER("sql_print_error"); 03988 03989 va_start(args, format); 03990 error_log_print(ERROR_LEVEL, format, args); 03991 va_end(args); 03992 03993 DBUG_VOID_RETURN; 03994 }
| static void usage | ( | void | ) | [static] |
Definition at line 837 of file mysqlbinlog.cc.
References my_long_options, my_print_help(), my_print_variables(), my_progname, and print_version().
00838 { 00839 print_version(); 00840 puts("By Monty and Sasha, for your professional use\n\ 00841 This software comes with NO WARRANTY: This is free software,\n\ 00842 and you are welcome to modify and redistribute it under the GPL license\n"); 00843 00844 printf("\ 00845 Dumps a MySQL binary log in a format usable for viewing or for piping to\n\ 00846 the mysql command line client\n\n"); 00847 printf("Usage: %s [options] log-files\n", my_progname); 00848 my_print_help(my_long_options); 00849 my_print_variables(my_long_options); 00850 }
Here is the call graph for this function:

short binlog_flags = 0 [static] |
| ulong bytes_received = 0L |
Definition at line 51 of file mysqlbinlog.cc.
| ulong bytes_sent = 0L |
Definition at line 51 of file mysqlbinlog.cc.
char* charset = 0 [static] |
Definition at line 76 of file mysqlbinlog.cc.
Referenced by _hash_init(), get_field(), Item_decimal::Item_decimal(), main(), mi_open(), my_regcomp(), str2my_decimal(), and trie_init().
const char* database = 0 [static] |
Definition at line 68 of file mysqlbinlog.cc.
Referenced by check_database(), cleanup(), and NdbDictionary::Dictionary::List::~List().
const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace" [static] |
Definition at line 59 of file mysqlbinlog.cc.
Definition at line 96 of file mysqlbinlog.cc.
Referenced by Append_block_log_event::Append_block_log_event(), check_header(), check_master_version(), Load_log_event::copy_log_event(), Create_file_log_event::Create_file_log_event(), Delete_file_log_event::Delete_file_log_event(), dump_local_log_entries(), dump_remote_log_entries(), Execute_load_log_event::Execute_load_log_event(), Intvar_log_event::Intvar_log_event(), Load_log_event::Load_log_event(), Log_event::Log_event(), process_event(), Query_log_event::Query_log_event(), Rand_log_event::Rand_log_event(), Log_event::read_log_event(), Rotate_log_event::Rotate_log_event(), Start_log_event_v3::Start_log_event_v3(), User_var_log_event::User_var_log_event(), and Xid_log_event::Xid_log_event().
const char* dirname_for_local_load = 0 [static] |
bool disable_log_bin = 0 [static] |
const char* host = 0 [static] |
Definition at line 71 of file mysqlbinlog.cc.
const char* load_default_groups[] = { "mysqlbinlog","client",0 } [static] |
Definition at line 61 of file mysqlbinlog.cc.
Definition at line 468 of file mysqlbinlog.cc.
Referenced by dump_remote_log_entries(), main(), and process_event().
struct my_option my_long_options[] [static] |
Definition at line 666 of file mysqlbinlog.cc.
Definition at line 86 of file mysqlbinlog.cc.
| ulong mysqld_net_retry_count = 10L |
Definition at line 52 of file mysqlbinlog.cc.
Definition at line 70 of file mysqlbinlog.cc.
Referenced by _mi_read_cache(), _mi_read_dynamic_record(), _mi_read_rnd_dynamic_record(), _mi_search_pos(), btr_copy_externally_stored_field(), btr_cur_parse_del_mark_set_clust_rec(), btr_cur_parse_del_mark_set_sec_rec(), btr_free_externally_stored_field(), buf_flush_batch(), MYSQL_BIN_LOG::close(), String::copy(), Dblqh::copy_bounds(), do_sync_with_master(), yaSSL::DoProcessReply(), dump_leaf_key(), Ndbfs::execFSAPPENDREQ(), Dbtup::execTUPFRAGREQ(), Dbtux::execTUX_BOUND_INFO(), fil_reset_too_high_lsns(), MYSQL_BIN_LOG::find_log_pos(), get_mm_leaf(), BitmaskImpl::getField(), group_concat_key_cmp_with_distinct(), group_concat_key_cmp_with_order(), history_arg_extract(), hostname_cache_init(), ieee_struct_field(), SCI_Transporter::init_remote(), SCI_Transporter::initLocalSegment(), key_cache_insert(), key_cache_read(), key_cache_write(), log_group_calc_lsn_offset(), main(), merge_buffers(), mi_create(), mi_open(), mlog_parse_nbytes(), mlog_parse_string(), mtr_memo_pop_all(), mtr_memo_release(), mtr_rollback_to_savepoint(), my_b_seek(), my_block_write(), my_getsystime(), my_tz_find(), mysql_stmt_row_seek(), ndb_logevent_get_next(), net_printf_error(), next_io_size(), pack_keys(), page_cur_parse_delete_rec(), page_cur_parse_insert_rec(), page_parse_delete_rec_list(), parse_date_time_format(), parse_ieee_bb(), parse_ieee_be(), parse_ieee_ty(), process_event(), AsyncFile::readReq(), rec_set_nth_field_sql_null(), regnext(), regtail(), Dbtup::releaseTabDescr(), remove_duplicates(), row_purge_upd_exist_or_extern(), s_print(), save_index(), String::set_or_copy_aligned(), BitmaskImpl::setField(), ShmemClientNode(), ShmemServerNode(), Protocol_prep::store_null(), trx_purge_choose_next_log(), trx_purge_get_next_rec(), trx_roll_pop_top_rec(), trx_undo_create(), trx_undo_get_undo_rec_low(), trx_undo_mem_create_at_db_start(), trx_undo_report_row_operation(), trx_undo_reuse_cached(), trx_undo_set_state_at_prepare(), Item_func_substr_index::val_str(), Item_func_replace::val_str(), write_huff_tree(), write_ieee_debugging_info(), ha_archive::write_row(), WriteMessage(), and AsyncFile::writeReq().
bool one_database = 0 [static] |
Definition at line 65 of file mysqlbinlog.cc.
bool opt_base64_output = 0 [static] |
bool opt_hexdump = 0 [static] |
uint opt_protocol = 0 [static] |
Definition at line 55 of file mysqlbinlog.cc.
char* pass = 0 [static] |
Definition at line 75 of file mysqlbinlog.cc.
Referenced by cleanup(), free_used_memory(), get_one_option(), ieee_read_reference(), main(), parse_args(), radixsort_for_str_ptr(), safe_connect(), tilde_expand(), and Item_func_substr_index::val_str().
int port = 0 [static] |
Definition at line 72 of file mysqlbinlog.cc.
Referenced by NDB_CPC::ComputerAddDialog::btnAdd_Click(), CommandInterpreter::connect(), createTCPTransporter(), do_connect(), Configuration::fetch_configuration(), fixPortNumber(), MgmtSrvr::getPort(), Instance::is_running(), main(), ndb_mgm_alloc_nodeid(), ndb_mgm_listen_event_internal(), LocalConfig::parseHostName(), safe_connect(), MgmtSrvr::sendStopMgmd(), TransporterRegistry::start_service(), and NDB_CPC::telnetclient::telnetClient::telnetClient().
my_bool remote_opt = 0 [static] |
Definition at line 69 of file mysqlbinlog.cc.
Referenced by dump_log_entries(), and get_one_option().
FILE* result_file [static] |
Definition at line 56 of file mysqlbinlog.cc.
Referenced by die(), get_one_option(), main(), parse_args(), and process_event().
Definition at line 48 of file mysqlbinlog.cc.
| char server_version[SERVER_VERSION_LENGTH] |
Definition at line 47 of file mysqlbinlog.cc.
my_bool short_form = 0 [static] |
const char* sock = 0 [static] |
Definition at line 73 of file mysqlbinlog.cc.
Referenced by change_user(), CLI_MYSQL_REAL_CONNECT(), dbConnect(), dbDisconnect(), fix_object_name(), handle_connections_sockets(), handle_request_for_tables(), main(), mysql_manager_connect(), NDB_CPC::telnetclient::telnetClient::OnRecievedData(), print_result(), process_all_databases(), process_all_tables_in_db(), safe_connect(), safe_exit(), SocketServer::setup(), SocketServer::tryBind(), and use_db().
my_time_t start_datetime = 0 [static] |
char* start_datetime_str [static] |
ulonglong start_position [static] |
Definition at line 78 of file mysqlbinlog.cc.
Referenced by check_header(), dump_local_log_entries(), dump_remote_log_entries(), and main().
my_time_t stop_datetime = MY_TIME_T_MAX [static] |
char * stop_datetime_str [static] |
bool stop_passed = 0 [static] |
ulonglong stop_position [static] |
| uint test_flags = 0 |
Definition at line 54 of file mysqlbinlog.cc.
Referenced by create_tmp_table(), handle_one_connection(), and my_net_init().
bool to_last_remote_log = 0 [static] |
const char* user = 0 [static] |
Definition at line 74 of file mysqlbinlog.cc.
1.4.7

