31 #include <my_bitmap.h>
32 #include "rpl_constants.h"
37 #include "rpl_utility.h"
39 #include "rpl_tblmap.h"
43 #include "rpl_record.h"
44 #include "rpl_reporting.h"
45 #include "sql_class.h"
46 #include "rpl_utility.h"
47 #include "rpl_filter.h"
52 typedef ulonglong sql_mode_t;
53 typedef struct st_db_worker_hash_entry db_worker_hash_entry;
55 #define PREFIX_SQL_LOAD "SQL_LOAD-"
67 #define TEMP_FILE_MAX_LEN UUID_LENGTH+38
79 #define ASSERT_OR_RETURN_ERROR(COND, ERRNO) \
80 do { if (!(COND)) return ERRNO; } while (0)
82 #define ASSERT_OR_RETURN_ERROR(COND, ERRNO) \
86 #define LOG_READ_EOF -1
87 #define LOG_READ_BOGUS -2
88 #define LOG_READ_IO -3
89 #define LOG_READ_MEM -5
90 #define LOG_READ_TRUNC -6
91 #define LOG_READ_TOO_LARGE -7
92 #define LOG_READ_CHECKSUM_FAILURE -8
94 #define LOG_EVENT_OFFSET 4
126 #define BINLOG_VERSION 4
133 #define ST_SERVER_VER_LEN 50
146 #define DUMPFILE_FLAG 0x1
147 #define OPT_ENCLOSED_FLAG 0x2
148 #define REPLACE_FLAG 0x4
149 #define IGNORE_FLAG 0x8
151 #define FIELD_TERM_EMPTY 0x1
152 #define ENCLOSED_EMPTY 0x2
153 #define LINE_TERM_EMPTY 0x4
154 #define LINE_START_EMPTY 0x8
155 #define ESCAPED_EMPTY 0x10
173 #define NUM_LOAD_DELIM_STRS 5
183 const char* field_term;
184 const char* enclosed;
185 const char* line_term;
186 const char* line_start;
188 int cached_new_format;
189 uint8 field_term_len,enclosed_len,line_term_len,line_start_len, escaped_len;
194 void force_new_format() { cached_new_format = 1;}
197 return (new_format() ?
198 field_term_len + enclosed_len + line_term_len +
199 line_start_len + escaped_len + 6 : 7);
202 const char* init(
const char*
buf,
const char* buf_end,
bool use_new_format);
205 return ((cached_new_format != -1) ? cached_new_format :
206 (cached_new_format=(field_term_len > 1 ||
208 line_term_len > 1 || line_start_len > 1 ||
234 #define LOG_EVENT_HEADER_LEN 19U
235 #define OLD_HEADER_LEN 13U
243 #define LOG_EVENT_MINIMAL_HEADER_LEN 19U
247 #define QUERY_HEADER_MINIMAL_LEN (4 + 4 + 1 + 2)
249 #define QUERY_HEADER_LEN (QUERY_HEADER_MINIMAL_LEN + 2)
250 #define STOP_HEADER_LEN 0
251 #define LOAD_HEADER_LEN (4 + 4 + 4 + 1 +1 + 4)
252 #define START_V3_HEADER_LEN (2 + ST_SERVER_VER_LEN + 4)
253 #define ROTATE_HEADER_LEN 8 // this is FROZEN (the Rotate post-header is frozen)
254 #define INTVAR_HEADER_LEN 0
255 #define CREATE_FILE_HEADER_LEN 4
256 #define APPEND_BLOCK_HEADER_LEN 4
257 #define EXEC_LOAD_HEADER_LEN 4
258 #define DELETE_FILE_HEADER_LEN 4
259 #define NEW_LOAD_HEADER_LEN LOAD_HEADER_LEN
260 #define RAND_HEADER_LEN 0
261 #define USER_VAR_HEADER_LEN 0
262 #define FORMAT_DESCRIPTION_HEADER_LEN (START_V3_HEADER_LEN+1+LOG_EVENT_TYPES)
263 #define XID_HEADER_LEN 0
264 #define BEGIN_LOAD_QUERY_HEADER_LEN APPEND_BLOCK_HEADER_LEN
265 #define ROWS_HEADER_LEN_V1 8
266 #define TABLE_MAP_HEADER_LEN 8
267 #define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN (4 + 4 + 4 + 1)
268 #define EXECUTE_LOAD_QUERY_HEADER_LEN (QUERY_HEADER_LEN + EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN)
269 #define INCIDENT_HEADER_LEN 2
270 #define HEARTBEAT_HEADER_LEN 0
271 #define IGNORABLE_HEADER_LEN 0
272 #define ROWS_HEADER_LEN_V2 10
279 #define MAX_DBS_IN_EVENT_MTS 16
286 #define OVER_MAX_DBS_IN_EVENT_MTS 254
293 #define MAX_SIZE_LOG_EVENT_STATUS (1U + 4 + \
304 1U + (MAX_DBS_IN_EVENT_MTS * (1 + NAME_LEN)) + \
307 #define MAX_LOG_EVENT_HEADER ( \
308 LOG_EVENT_HEADER_LEN + \
310 EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN + \
311 MAX_SIZE_LOG_EVENT_STATUS + \
319 #define MAX_MAX_ALLOWED_PACKET 1024*1024*1024
326 #define EVENT_TYPE_OFFSET 4
327 #define SERVER_ID_OFFSET 5
328 #define EVENT_LEN_OFFSET 9
329 #define LOG_POS_OFFSET 13
330 #define FLAGS_OFFSET 17
334 #define ST_BINLOG_VER_OFFSET 0
335 #define ST_SERVER_VER_OFFSET 2
336 #define ST_CREATED_OFFSET (ST_SERVER_VER_OFFSET + ST_SERVER_VER_LEN)
337 #define ST_COMMON_HEADER_LEN_OFFSET (ST_CREATED_OFFSET + 4)
341 #define SL_MASTER_PORT_OFFSET 8
342 #define SL_MASTER_POS_OFFSET 0
343 #define SL_MASTER_HOST_OFFSET 10
347 #define Q_THREAD_ID_OFFSET 0
348 #define Q_EXEC_TIME_OFFSET 4
349 #define Q_DB_LEN_OFFSET 8
350 #define Q_ERR_CODE_OFFSET 9
351 #define Q_STATUS_VARS_LEN_OFFSET 11
352 #define Q_DATA_OFFSET QUERY_HEADER_LEN
354 #define Q_FLAGS2_CODE 0
355 #define Q_SQL_MODE_CODE 1
361 #define Q_CATALOG_CODE 2
362 #define Q_AUTO_INCREMENT 3
363 #define Q_CHARSET_CODE 4
364 #define Q_TIME_ZONE_CODE 5
372 #define Q_CATALOG_NZ_CODE 6
374 #define Q_LC_TIME_NAMES_CODE 7
376 #define Q_CHARSET_DATABASE_CODE 8
378 #define Q_TABLE_MAP_FOR_UPDATE_CODE 9
380 #define Q_MASTER_DATA_WRITTEN_CODE 10
389 #define Q_UPDATED_DB_NAMES 12
391 #define Q_MICROSECONDS 13
396 #define I_TYPE_OFFSET 0
397 #define I_VAL_OFFSET 1
400 #define RAND_SEED1_OFFSET 0
401 #define RAND_SEED2_OFFSET 8
404 #define UV_VAL_LEN_SIZE 4
405 #define UV_VAL_IS_NULL 1
406 #define UV_VAL_TYPE_SIZE 1
407 #define UV_NAME_LEN_SIZE 4
408 #define UV_CHARSET_NUMBER_SIZE 4
411 #define L_THREAD_ID_OFFSET 0
412 #define L_EXEC_TIME_OFFSET 4
413 #define L_SKIP_LINES_OFFSET 8
414 #define L_TBL_LEN_OFFSET 12
415 #define L_DB_LEN_OFFSET 13
416 #define L_NUM_FIELDS_OFFSET 14
417 #define L_SQL_EX_OFFSET 18
418 #define L_DATA_OFFSET LOAD_HEADER_LEN
421 #define R_POS_OFFSET 0
422 #define R_IDENT_OFFSET 8
427 #define CF_FILE_ID_OFFSET 0
428 #define CF_DATA_OFFSET CREATE_FILE_HEADER_LEN
431 #define AB_FILE_ID_OFFSET 0
432 #define AB_DATA_OFFSET APPEND_BLOCK_HEADER_LEN
435 #define EL_FILE_ID_OFFSET 0
438 #define DF_FILE_ID_OFFSET 0
441 #define TM_MAPID_OFFSET 0
442 #define TM_FLAGS_OFFSET 6
445 #define RW_MAPID_OFFSET 0
446 #define RW_FLAGS_OFFSET 6
447 #define RW_VHLEN_OFFSET 8
448 #define RW_V_TAG_LEN 1
449 #define RW_V_EXTRAINFO_TAG 0
452 #define ELQ_FILE_ID_OFFSET QUERY_HEADER_LEN
453 #define ELQ_FN_POS_START_OFFSET ELQ_FILE_ID_OFFSET + 4
454 #define ELQ_FN_POS_END_OFFSET ELQ_FILE_ID_OFFSET + 8
455 #define ELQ_DUP_HANDLING_OFFSET ELQ_FILE_ID_OFFSET + 12
458 #define BINLOG_MAGIC "\xfe\x62\x69\x6e"
472 #define LOG_EVENT_TIME_F 0x1
473 #define LOG_EVENT_FORCED_ROTATE_F 0x2
498 #define LOG_EVENT_BINLOG_IN_USE_F 0x1
508 #define LOG_EVENT_THREAD_SPECIFIC_F 0x4
523 #define LOG_EVENT_SUPPRESS_USE_F 0x8
540 #define LOG_EVENT_ARTIFICIAL_F 0x20
548 #define LOG_EVENT_RELAY_LOG_F 0x40
559 #define LOG_EVENT_IGNORABLE_F 0x80
568 #define LOG_EVENT_NO_FILTER_F 0x100
579 #define LOG_EVENT_MTS_ISOLATE_F 0x200
603 #define OPTIONS_WRITTEN_TO_BIN_LOG \
604 (OPTION_AUTO_IS_NULL | OPTION_NO_FOREIGN_KEY_CHECKS | \
605 OPTION_RELAXED_UNIQUE_CHECKS | OPTION_NOT_AUTOCOMMIT)
608 #define EXPECTED_OPTIONS \
609 ((ULL(1) << 14) | (ULL(1) << 26) | (ULL(1) << 27) | (ULL(1) << 19))
611 #if OPTIONS_WRITTEN_TO_BIN_LOG != EXPECTED_OPTIONS
612 #error OPTIONS_WRITTEN_TO_BIN_LOG must NOT change their values!
614 #undef EXPECTED_OPTIONS
616 enum enum_binlog_checksum_alg {
617 BINLOG_CHECKSUM_ALG_OFF= 0,
619 BINLOG_CHECKSUM_ALG_CRC32= 1,
620 BINLOG_CHECKSUM_ALG_ENUM_END,
621 BINLOG_CHECKSUM_ALG_UNDEF= 255
625 #define CHECKSUM_CRC32_SIGNATURE_LEN 4
629 #define BINLOG_CHECKSUM_LEN CHECKSUM_CRC32_SIGNATURE_LEN
630 #define BINLOG_CHECKSUM_ALG_DESC_LEN 1
651 CREATE_FILE_EVENT= 8,
652 APPEND_BLOCK_EVENT= 9,
654 DELETE_FILE_EVENT= 11,
663 FORMAT_DESCRIPTION_EVENT= 15,
665 BEGIN_LOAD_QUERY_EVENT= 17,
666 EXECUTE_LOAD_QUERY_EVENT= 18,
668 TABLE_MAP_EVENT = 19,
674 PRE_GA_WRITE_ROWS_EVENT = 20,
675 PRE_GA_UPDATE_ROWS_EVENT = 21,
676 PRE_GA_DELETE_ROWS_EVENT = 22,
681 WRITE_ROWS_EVENT_V1 = 23,
682 UPDATE_ROWS_EVENT_V1 = 24,
683 DELETE_ROWS_EVENT_V1 = 25,
694 HEARTBEAT_LOG_EVENT= 27,
702 IGNORABLE_LOG_EVENT= 28,
703 ROWS_QUERY_LOG_EVENT= 29,
706 WRITE_ROWS_EVENT = 30,
707 UPDATE_ROWS_EVENT = 31,
708 DELETE_ROWS_EVENT = 32,
711 ANONYMOUS_GTID_LOG_EVENT= 34,
713 PREVIOUS_GTIDS_LOG_EVENT= 35,
727 #define LOG_EVENT_TYPES (ENUM_END_EVENT-1)
731 INVALID_INT_EVENT = 0, LAST_INSERT_ID_EVENT = 1, INSERT_ID_EVENT = 2
744 class Slave_committed_queue;
747 enum enum_base64_output_mode {
748 BASE64_OUTPUT_NEVER= 0,
749 BASE64_OUTPUT_AUTO= 1,
750 BASE64_OUTPUT_UNSPEC= 2,
751 BASE64_OUTPUT_DECODE_ROWS= 3,
753 BASE64_OUTPUT_MODE_COUNT
768 typedef struct st_print_event_info
776 char db[FN_REFLEN+1];
779 bool sql_mode_inited;
781 ulong auto_increment_increment, auto_increment_offset;
785 uint lc_time_names_number;
786 uint charset_database_number;
788 bool thread_id_printed;
790 st_print_event_info();
792 ~st_print_event_info() {
793 close_cached_file(&head_cache);
794 close_cached_file(&body_cache);
797 {
return my_b_inited(&head_cache) && my_b_inited(&body_cache); }
802 enum_base64_output_mode base64_output_mode;
809 bool printed_fd_event;
810 my_off_t hexdump_from;
811 uint8 common_header_len;
826 bool have_unflushed_events;
836 bool skipped_event_in_transaction;
1000 enum enum_event_cache_type
1002 EVENT_INVALID_CACHE= 0,
1014 EVENT_TRANSACTIONAL_CACHE,
1026 enum enum_event_logging_type
1028 EVENT_INVALID_LOGGING= 0,
1033 EVENT_NORMAL_LOGGING,
1038 EVENT_IMMEDIATE_LOGGING,
1042 EVENT_CACHE_LOGGING_COUNT
1051 typedef unsigned char Byte;
1094 uint32 unmasked_server_id;
1151 db_worker_hash_entry *mts_assigned_partitions[MAX_DBS_IN_EVENT_MTS];
1153 Log_event(enum_event_cache_type cache_type_arg= EVENT_INVALID_CACHE,
1154 enum_event_logging_type logging_type_arg= EVENT_INVALID_LOGGING);
1155 Log_event(THD* thd_arg, uint16 flags_arg,
1156 enum_event_cache_type cache_type_arg,
1157 enum_event_logging_type logging_type_arg);
1201 uint8 checksum_alg_arg,
1202 const char *log_file_name_arg= NULL,
1203 bool* is_binlog_active= NULL);
1209 static void init_show_field_list(
List<Item>* field_list);
1210 #ifdef HAVE_REPLICATION
1211 int net_send(
Protocol *protocol,
const char* log_name, my_off_t pos);
1220 virtual int pack_info(
Protocol *protocol);
1223 virtual const char* get_db()
1225 return thd ? thd->db : 0;
1227 #else // ifdef MYSQL_SERVER
1228 Log_event(enum_event_cache_type cache_type_arg= EVENT_INVALID_CACHE,
1229 enum_event_logging_type logging_type_arg= EVENT_INVALID_LOGGING)
1236 *description_event, my_bool crc_check);
1238 virtual void print(FILE*
file, PRINT_EVENT_INFO* print_event_info) = 0;
1240 void print_header(
IO_CACHE*
file, PRINT_EVENT_INFO* print_event_info,
1242 void print_base64(
IO_CACHE*
file, PRINT_EVENT_INFO* print_event_info,
1244 #endif // ifdef MYSQL_SERVER ... else
1255 static void *
operator new(
size_t size)
1257 return (
void*) my_malloc((uint)
size, MYF(MY_WME|MY_FAE));
1260 static void operator delete(
void *ptr, size_t)
1266 static void *
operator new(size_t,
void* ptr) {
return ptr; }
1267 static void operator delete(
void*,
void*) { }
1268 bool wrapper_my_b_safe_write(
IO_CACHE*
file,
const uchar*
buf, ulong data_length);
1273 my_bool need_checksum();
1277 return(write_header(file, get_data_size()) ||
1278 write_data_header(file) ||
1279 write_data_body(file) ||
1280 write_footer(file));
1282 virtual bool write_data_header(
IO_CACHE* file)
1284 virtual bool write_data_body(
IO_CACHE* file __attribute__((unused)))
1286 inline time_t get_time()
1288 if (!when.tv_sec && !when.tv_usec)
1290 THD *tmp_thd= thd ? thd : current_thd;
1292 when= tmp_thd->start_time;
1294 my_micro_time_to_timeval(my_micro_time(), &when);
1296 return (time_t) when.tv_sec;
1300 virtual bool is_valid()
const = 0;
1307 inline bool is_using_trans_cache()
const
1311 inline bool is_using_stmt_cache()
const
1315 inline bool is_using_immediate_logging()
const
1320 *description_event);
1321 virtual ~
Log_event() { free_temp_buf();}
1322 void register_temp_buf(
char*
buf) { temp_buf =
buf; }
1323 void free_temp_buf()
1335 virtual int get_data_size() {
return 0;}
1336 static Log_event* read_log_event(
const char*
buf, uint event_len,
1339 *description_event, my_bool crc_check);
1351 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
1361 enum enum_mts_event_exec_mode
1366 EVENT_EXEC_PARALLEL,
1394 bool is_mts_sequential_exec()
1397 get_type_code() == START_EVENT_V3 ||
1398 get_type_code() == STOP_EVENT ||
1399 get_type_code() == ROTATE_EVENT ||
1400 get_type_code() == LOAD_EVENT ||
1401 get_type_code() == SLAVE_EVENT ||
1402 get_type_code() == CREATE_FILE_EVENT ||
1403 get_type_code() == DELETE_FILE_EVENT ||
1404 get_type_code() == NEW_LOAD_EVENT ||
1405 get_type_code() == EXEC_LOAD_EVENT ||
1406 get_type_code() == FORMAT_DESCRIPTION_EVENT||
1408 get_type_code() == INCIDENT_EVENT;
1423 enum enum_mts_event_exec_mode get_mts_execution_mode(ulong slave_server_id,
1426 if ((get_type_code() == FORMAT_DESCRIPTION_EVENT &&
1427 ((server_id == (uint32) ::server_id) || (log_pos == 0))) ||
1428 (get_type_code() == ROTATE_EVENT &&
1429 ((server_id == (uint32) ::server_id) ||
1431 && mts_in_group ))))
1432 return EVENT_EXEC_ASYNC;
1433 else if (is_mts_sequential_exec())
1434 return EVENT_EXEC_SYNC;
1436 return EVENT_EXEC_PARALLEL;
1453 res->push_back(strdup_root(mem_root, get_db()));
1465 virtual void set_mts_isolate_group()
1467 DBUG_ASSERT(ends_group() ||
1468 get_type_code() == QUERY_EVENT ||
1469 get_type_code() == EXEC_LOAD_EVENT ||
1470 get_type_code() == EXECUTE_LOAD_QUERY_EVENT);
1480 bool contains_partition_info(
bool);
1487 virtual uint8 mts_number_dbs() {
return 1; }
1505 virtual bool starts_group() {
return FALSE; }
1511 virtual bool ends_group() {
return FALSE; }
1533 return do_update_pos(rli);
1544 return do_shall_skip(rli);
1567 virtual int do_apply_event_worker(Slave_worker *w);
2008 Log_event::Byte* data_buf;
2011 const char* catalog;
2028 ulong slave_proxy_id;
2057 uint16 status_vars_len;
2069 bool sql_mode_inited;
2070 bool charset_inited;
2074 sql_mode_t sql_mode;
2075 ulong auto_increment_increment, auto_increment_offset;
2078 const char *time_zone_str;
2079 uint lc_time_names_number;
2080 uint charset_database_number;
2085 ulonglong table_map_for_update;
2095 uint32 master_data_written;
2100 uchar mts_accessed_dbs;
2101 char mts_accessed_db_names[MAX_DBS_IN_EVENT_MTS][NAME_LEN];
2105 Query_log_event(THD* thd_arg,
const char* query_arg, ulong query_length,
2106 bool using_trans,
bool immediate,
bool suppress_use,
2107 int error,
bool ignore_command= FALSE);
2108 const char* get_db() {
return db; }
2117 if (mts_accessed_dbs == OVER_MAX_DBS_IN_EVENT_MTS)
2120 mts_accessed_db_names[0][0]= 0;
2121 res->push_back((
char*) mts_accessed_db_names[0]);
2125 for (uchar
i= 0;
i < mts_accessed_dbs;
i++)
2127 char *db_name= mts_accessed_db_names[
i];
2130 if (!rpl_filter->is_rewrite_empty() && !strcmp(get_db(), db_name))
2133 const char *db_filtered= rpl_filter->get_rewrite_db(db_name, &dummy_len);
2135 if (strcmp(db_name, db_filtered))
2136 db_name= (
char*)db_filtered;
2139 res->push_back(db_name);
2145 void attach_temp_tables_worker(THD*);
2146 void detach_temp_tables_worker(THD*);
2148 virtual uchar mts_number_dbs() {
return mts_accessed_dbs; }
2150 #ifdef HAVE_REPLICATION
2154 void print_query_header(
IO_CACHE* file, PRINT_EVENT_INFO* print_event_info);
2155 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
2170 virtual bool write_post_header_for_derived(
IO_CACHE* file) {
return FALSE; }
2172 bool is_valid()
const {
return query != 0; }
2178 virtual ulong get_post_header_size_for_derived() {
return 0; }
2182 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
2188 const char *query_arg,
2195 bool is_trans_keyword()
2208 return !strncmp(
query,
"BEGIN", q_len) ||
2209 !strncmp(
query,
"COMMIT", q_len) ||
2210 !strncasecmp(
query,
"SAVEPOINT", 9) ||
2211 !strncasecmp(
query,
"ROLLBACK", 8);
2219 virtual bool ends_group()
2222 !strncmp(
query,
"COMMIT", q_len) ||
2223 (!strncasecmp(
query, STRING_WITH_LEN(
"ROLLBACK"))
2224 && strncasecmp(
query, STRING_WITH_LEN(
"ROLLBACK TO ")));
2432 int copy_log_event(
const char *buf, ulong event_len,
2437 uint get_query_buffer_length();
2438 void print_query(
bool need_db,
const char *cs,
char *buf,
char **end,
2439 char **fn_start,
char **fn_end);
2441 ulong slave_proxy_id;
2442 uint32 table_name_len;
2452 const uchar* field_lens;
2453 uint32 field_block_len;
2455 const char* table_name;
2474 void set_fname_outside_temp_buf(
const char *afname, uint alen)
2481 int check_fname_outside_temp_buf()
2491 const char* table_name_arg,
2493 bool is_concurrent_arg,
2494 enum enum_duplicates handle_dup,
bool ignore,
2496 void set_fields(
const char* db,
List<Item> &fields_arg,
2498 const char* get_db() {
return db; }
2499 #ifdef HAVE_REPLICATION
2503 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
2504 void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
bool commented);
2519 return sql_ex.new_format() ? NEW_LOAD_EVENT: LOAD_EVENT;
2522 bool write_data_header(
IO_CACHE* file);
2523 bool write_data_body(
IO_CACHE* file);
2525 bool is_valid()
const {
return table_name != 0; }
2528 return (table_name_len + db_len + 2 + fname_len
2530 + sql_ex.data_size() + field_block_len + num_fields);
2534 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
2537 return do_apply_event(thd->slave_net,rli,0);
2541 bool use_rli_only_for_errors);
2545 extern char server_version[SERVER_VERSION_LENGTH];
2588 uint16 binlog_version;
2589 char server_version[ST_SERVER_VER_LEN];
2594 bool dont_set_created;
2598 #ifdef HAVE_REPLICATION
2603 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
2613 bool is_valid()
const {
return 1; }
2616 return START_V3_HEADER_LEN;
2620 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
2628 if (this->server_id == ::server_id)
2656 uint8 common_header_len;
2657 uint8 number_of_event_types;
2662 uint8 *post_header_len;
2663 uchar server_version_split[3];
2664 const uint8 *event_type_permutation;
2669 *description_event);
2672 my_free(post_header_len);
2674 Log_event_type get_type_code() {
return FORMAT_DESCRIPTION_EVENT;}
2678 bool header_is_valid()
const
2680 return ((common_header_len >= ((binlog_version==1) ? OLD_HEADER_LEN :
2681 LOG_EVENT_MINIMAL_HEADER_LEN)) &&
2682 (post_header_len != NULL));
2685 bool version_is_valid()
const
2688 return !(server_version_split[0] == 0 &&
2689 server_version_split[1] == 0 &&
2690 server_version_split[2] == 0);
2693 bool is_valid()
const
2695 return header_is_valid() && version_is_valid();
2705 return FORMAT_DESCRIPTION_HEADER_LEN;
2712 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
2766 enum_event_cache_type cache_type_arg,
2767 enum_event_logging_type logging_type_arg)
2768 :
Log_event(thd_arg, 0, cache_type_arg, logging_type_arg),
2769 val(val_arg), type(type_arg) { }
2770 #ifdef HAVE_REPLICATION
2774 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
2781 const char* get_var_type_name();
2782 int get_data_size() {
return 9; ;}
2786 bool is_valid()
const {
return 1; }
2789 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
2843 Rand_log_event(THD* thd_arg, ulonglong seed1_arg, ulonglong seed2_arg,
2844 enum_event_cache_type cache_type_arg,
2845 enum_event_logging_type logging_type_arg)
2846 :
Log_event(thd_arg, 0, cache_type_arg, logging_type_arg),
2847 seed1(seed1_arg), seed2(seed2_arg) { }
2848 #ifdef HAVE_REPLICATION
2852 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
2859 int get_data_size() {
return 16; }
2863 bool is_valid()
const {
return 1; }
2866 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
2882 typedef ulonglong my_xid;
2893 Log_event::EVENT_TRANSACTIONAL_CACHE,
2894 Log_event::EVENT_NORMAL_LOGGING),
2897 #ifdef HAVE_REPLICATION
2901 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
2908 int get_data_size() {
return sizeof(xid); }
2912 bool is_valid()
const {
return 1; }
2913 virtual bool ends_group() {
return TRUE; }
2915 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
2917 virtual int do_apply_event_worker(Slave_worker *rli);
2919 bool do_commit(THD *thd);
2944 uint charset_number;
2949 query_id_t query_id;
2951 char *val_arg, ulong val_len_arg, Item_result type_arg,
2952 uint charset_number_arg, uchar flags_arg,
2953 enum_event_cache_type cache_type_arg,
2954 enum_event_logging_type logging_type_arg)
2955 :
Log_event(thd_arg, 0, cache_type_arg, logging_type_arg), name(name_arg),
2956 name_len(name_len_arg), val(val_arg), val_len(val_len_arg), type(type_arg),
2957 charset_number(charset_number_arg), flags(flags_arg), deferred(
false)
2963 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
2977 bool is_deferred() {
return deferred; }
2982 void set_deferred(query_id_t qid) { deferred=
true; query_id= qid; }
2984 bool is_valid()
const {
return name != 0; }
2987 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3010 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
3019 bool is_valid()
const {
return 1; }
3022 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3030 if (this->server_id == ::server_id)
3094 const char* new_log_ident;
3101 ulonglong pos_arg, uint flags);
3102 #ifdef HAVE_REPLICATION
3106 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
3113 if (flags & DUP_NAME)
3114 my_free((
void*) new_log_ident);
3117 int get_data_size() {
return ident_len + ROTATE_HEADER_LEN;}
3118 bool is_valid()
const {
return new_log_ident != 0; }
3124 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3150 const char *event_buf;
3153 bool inited_from_old;
3157 const char* table_name_arg,
3159 bool is_concurrent_arg,
3160 enum enum_duplicates handle_dup,
bool ignore,
3161 uchar* block_arg, uint block_len_arg,
3163 #ifdef HAVE_REPLICATION
3167 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
3168 void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
3176 my_free((
void*) event_buf);
3181 return fake_base ? Load_log_event::get_type_code() : CREATE_FILE_EVENT;
3185 return (fake_base ? Load_log_event::get_data_size() :
3186 Load_log_event::get_data_size() +
3189 bool is_valid()
const {
return inited_from_old || block != 0; }
3191 bool write_data_header(
IO_CACHE* file);
3192 bool write_data_body(
IO_CACHE* file);
3201 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3234 uint block_len_arg,
bool using_trans);
3235 #ifdef HAVE_REPLICATION
3237 virtual int get_create_or_append()
const;
3240 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
3245 *description_event);
3248 int get_data_size() {
return block_len + APPEND_BLOCK_HEADER_LEN ;}
3249 bool is_valid()
const {
return block != 0; }
3252 const char* get_db() {
return db; }
3256 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3276 #ifdef HAVE_REPLICATION
3280 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
3281 void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
3289 int get_data_size() {
return DELETE_FILE_HEADER_LEN ;}
3290 bool is_valid()
const {
return file_id != 0; }
3293 const char* get_db() {
return db; }
3297 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3317 #ifdef HAVE_REPLICATION
3321 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
3326 *description_event);
3329 int get_data_size() {
return EXEC_LOAD_HEADER_LEN ;}
3330 bool is_valid()
const {
return file_id != 0; }
3333 const char* get_db() {
return db; }
3335 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3336 virtual uint8 mts_number_dbs() {
return OVER_MAX_DBS_IN_EVENT_MTS; }
3340 res->push_back(strdup_root(mem_root,
""));
3346 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3366 uchar* block_arg, uint block_len_arg,
3368 #ifdef HAVE_REPLICATION
3370 int get_create_or_append()
const;
3375 *description_event);
3377 Log_event_type get_type_code() {
return BEGIN_LOAD_QUERY_EVENT; }
3379 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3388 enum enum_load_dup_handling { LOAD_DUP_ERROR= 0, LOAD_DUP_IGNORE,
3413 enum_load_dup_handling dup_handling;
3417 ulong query_length, uint fn_pos_start_arg,
3418 uint fn_pos_end_arg,
3419 enum_load_dup_handling dup_handling_arg,
3420 bool using_trans,
bool immediate,
3421 bool suppress_use,
int errcode);
3422 #ifdef HAVE_REPLICATION
3426 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
3428 void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
3429 const char *local_fname);
3433 *description_event);
3436 Log_event_type get_type_code() {
return EXECUTE_LOAD_QUERY_EVENT; }
3437 bool is_valid()
const {
return Query_log_event::is_valid() && file_id != 0; }
3439 ulong get_post_header_size_for_derived();
3441 bool write_post_header_for_derived(
IO_CACHE* file);
3445 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3457 class Unknown_log_event:
public Log_event
3465 Unknown_log_event(
const char* buf,
3469 ~Unknown_log_event() {}
3470 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
3472 bool is_valid()
const {
return 1; }
3475 char *
str_to_hex(
char *
to,
const char *from, uint len);
3797 TYPE_CODE = TABLE_MAP_EVENT
3824 typedef uint16 flag_set;
3830 TM_BIT_LEN_EXACT_F = (1
U << 0),
3831 TM_REFERRED_FK_DB_F = (1
U << 1)
3834 flag_set get_flags(flag_set flag)
const {
return m_flags & flag; }
3838 bool is_transactional);
3840 #ifdef HAVE_REPLICATION
3850 return new table_def(m_coltype, m_colcnt, m_field_metadata,
3851 m_field_metadata_size, m_null_bits, m_flags);
3854 const Table_id& get_table_id()
const {
return m_table_id; }
3855 const char *get_table_name()
const {
return m_tblnam; }
3856 const char *get_db_name()
const {
return m_dbnam; }
3858 virtual Log_event_type get_type_code() {
return TABLE_MAP_EVENT; }
3859 virtual bool is_valid()
const {
return m_memory != NULL; }
3861 virtual int get_data_size() {
return (uint) m_data_size; }
3863 virtual int save_field_metadata();
3864 virtual bool write_data_header(
IO_CACHE *file);
3865 virtual bool write_data_body(
IO_CACHE *file);
3866 virtual const char *get_db() {
return m_dbnam; }
3867 virtual uint8 mts_number_dbs()
3869 return get_flags(TM_REFERRED_FK_DB_F) ? OVER_MAX_DBS_IN_EVENT_MTS : 1;
3874 const char *db_name= get_db();
3876 if (!rpl_filter->is_rewrite_empty() && !get_flags(TM_REFERRED_FK_DB_F))
3879 const char *db_filtered= rpl_filter->get_rewrite_db(db_name, &dummy_len);
3881 if (strcmp(db_name, db_filtered))
3882 db_name= db_filtered;
3885 res->push_back(strdup_root(mem_root,
3886 get_flags(TM_REFERRED_FK_DB_F) ?
"" : db_name));
3892 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3893 virtual int pack_info(
Protocol *protocol);
3897 virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
3902 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
3911 char const *m_dbnam;
3913 char const *m_tblnam;
3924 uchar *m_field_metadata;
3928 ulong m_field_metadata_size;
3930 uchar *m_meta_memory;
3952 enum row_lookup_mode {
3953 ROW_LOOKUP_UNDEFINED= 0,
3954 ROW_LOOKUP_NOT_NEEDED= 1,
3955 ROW_LOOKUP_INDEX_SCAN= 2,
3956 ROW_LOOKUP_TABLE_SCAN= 3,
3957 ROW_LOOKUP_HASH_SCAN= 4
3983 STMT_END_F = (1
U << 0),
3986 NO_FOREIGN_KEY_CHECKS_F = (1
U << 1),
3989 RELAXED_UNIQUE_CHECKS_F = (1
U << 2),
3998 typedef uint16 flag_set;
4008 void set_flags(flag_set flags_arg) { m_flags |= flags_arg; }
4009 void clear_flags(flag_set flags_arg) { m_flags &= ~flags_arg; }
4010 flag_set get_flags(flag_set flags_arg)
const {
return m_flags & flags_arg; }
4015 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4016 virtual int pack_info(
Protocol *protocol);
4021 virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info)= 0;
4023 PRINT_EVENT_INFO *print_event_info);
4025 PRINT_EVENT_INFO *print_event_info,
4027 const uchar *ptr,
const uchar *prefix);
4031 int add_row_data(uchar *data,
size_t length)
4033 return do_add_row_data(data,length);
4038 virtual int get_data_size();
4040 MY_BITMAP const *get_cols()
const {
return &m_cols; }
4041 MY_BITMAP const *get_cols_ai()
const {
return &m_cols_ai; }
4042 size_t get_width()
const {
return m_width; }
4043 const Table_id& get_table_id()
const {
return m_table_id; }
4045 #if defined(MYSQL_SERVER)
4066 virtual bool read_write_bitmaps_cmp(
TABLE *
table)
4070 switch (get_general_type_code())
4072 case DELETE_ROWS_EVENT:
4073 res= bitmap_cmp(get_cols(), table->read_set);
4075 case UPDATE_ROWS_EVENT:
4076 res= (bitmap_cmp(get_cols(), table->read_set) &&
4077 bitmap_cmp(get_cols_ai(), table->write_set));
4079 case WRITE_ROWS_EVENT:
4080 res= bitmap_cmp(get_cols(), table->write_set);
4094 virtual bool write_data_header(
IO_CACHE *file);
4095 virtual bool write_data_body(
IO_CACHE *file);
4096 virtual const char *get_db() {
return m_table->s->db.str; }
4104 virtual bool is_valid()
const
4106 return m_rows_buf && m_cols.bitmap;
4111 const uchar* get_extra_row_data()
const {
return m_extra_row_data; }
4120 MY_BITMAP const *cols,
bool is_transactional,
4122 const uchar* extra_row_info);
4128 void print_helper(FILE *, PRINT_EVENT_INFO *,
char const *
const name);
4132 virtual int do_add_row_data(uchar *data,
size_t length);
4141 #ifndef MYSQL_CLIENT
4163 ulong m_master_reclength;
4166 uint32 m_bitbuf[128/(
sizeof(uint32)*8)];
4167 uint32 m_bitbuf_ai[128/(
sizeof(uint32)*8)];
4177 uchar *m_extra_row_data;
4182 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4183 const uchar *m_curr_row;
4184 const uchar *m_curr_row_end;
4186 uchar *last_hashed_key;
4195 DBUG_ASSERT(m_table);
4198 int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, cols,
4199 &m_curr_row_end, &m_master_reclength);
4200 if (m_curr_row_end > m_rows_end)
4201 my_error(ER_SLAVE_CORRUPT_EVENT, MYF(0));
4213 void decide_row_lookup_algorithm_and_key();
4219 int row_operations_scan_and_key_setup();
4225 int row_operations_scan_and_key_teardown(
int error);
4231 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4294 int handle_idempotent_and_ignored_errors(
Relay_log_info const *rli,
int *err);
4341 int open_record_scan();
4349 int close_record_scan();
4363 int next_record_scan(
bool first_read);
4371 int add_key_to_distinct_keyset();
4416 TYPE_CODE = WRITE_ROWS_EVENT
4419 #if defined(MYSQL_SERVER)
4421 bool is_transactional,
4422 const uchar* extra_row_info);
4424 #ifdef HAVE_REPLICATION
4428 #if defined(MYSQL_SERVER)
4429 static bool binlog_row_logging_function(THD *thd,
TABLE *table,
4430 bool is_transactional,
4431 const uchar *before_record
4432 __attribute__((unused)),
4433 const uchar *after_record)
4435 return thd->binlog_write_row(table, is_transactional,
4436 after_record, NULL);
4447 void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
4450 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4476 TYPE_CODE = UPDATE_ROWS_EVENT
4483 bool is_transactional,
4484 const uchar* extra_row_info);
4487 bool is_transactional,
4488 const uchar* extra_row_info);
4495 #ifdef HAVE_REPLICATION
4501 static bool binlog_row_logging_function(THD *thd,
TABLE *table,
4502 bool is_transactional,
4503 const uchar *before_record,
4504 const uchar *after_record)
4506 return thd->binlog_update_row(table, is_transactional,
4507 before_record, after_record, NULL);
4511 virtual bool is_valid()
const
4513 return Rows_log_event::is_valid() && m_cols_ai.bitmap;
4520 void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
4523 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4556 TYPE_CODE = DELETE_ROWS_EVENT
4561 bool is_transactional,
const uchar* extra_row_info);
4563 #ifdef HAVE_REPLICATION
4568 static bool binlog_row_logging_function(THD *thd,
TABLE *table,
4569 bool is_transactional,
4570 const uchar *before_record,
4571 const uchar *after_record
4572 __attribute__((unused)))
4574 return thd->binlog_delete_row(table, is_transactional,
4575 before_record, NULL);
4583 void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
4586 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4637 Log_event::EVENT_IMMEDIATE_LOGGING), m_incident(incident)
4639 DBUG_ENTER(
"Incident_log_event::Incident_log_event");
4640 DBUG_PRINT(
"enter", (
"m_incident: %d", m_incident));
4641 m_message.str= NULL;
4642 m_message.length= 0;
4648 Log_event::EVENT_NO_CACHE,
4649 Log_event::EVENT_IMMEDIATE_LOGGING), m_incident(incident)
4651 DBUG_ENTER(
"Incident_log_event::Incident_log_event");
4652 DBUG_PRINT(
"enter", (
"m_incident: %d", m_incident));
4653 m_message.str= NULL;
4654 m_message.length= 0;
4655 if (!(m_message.str= (
char*) my_malloc(msg.length+1, MYF(MY_WME))))
4658 m_incident= INCIDENT_NONE;
4661 strmake(m_message.str, msg.str, msg.length);
4662 m_message.length= msg.length;
4677 virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
4680 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4684 virtual bool write_data_header(
IO_CACHE *file);
4685 virtual bool write_data_body(
IO_CACHE *file);
4687 virtual Log_event_type get_type_code() {
return INCIDENT_EVENT; }
4689 virtual bool is_valid()
const
4691 return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT;
4693 virtual int get_data_size() {
4694 return INCIDENT_HEADER_LEN + 1 + (uint) m_message.length;
4698 const char *description()
const;
4700 Incident m_incident;
4724 #ifndef MYSQL_CLIENT
4727 Log_event::EVENT_STMT_CACHE,
4728 Log_event::EVENT_NORMAL_LOGGING)
4730 DBUG_ENTER(
"Ignorable_log_event::Ignorable_log_event");
4739 #ifndef MYSQL_CLIENT
4744 virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
4747 virtual Log_event_type get_type_code() {
return IGNORABLE_LOG_EVENT; }
4749 virtual bool is_valid()
const {
return 1; }
4751 virtual int get_data_size() {
return IGNORABLE_HEADER_LEN; }
4757 #ifndef MYSQL_CLIENT
4761 DBUG_ENTER(
"Rows_query_log_event::Rows_query_log_event");
4762 if (!(m_rows_query= (
char*) my_malloc(query_len + 1, MYF(MY_WME))))
4764 my_snprintf(m_rows_query, query_len + 1,
"%s", query);
4765 DBUG_PRINT(
"enter", (
"%s", m_rows_query));
4770 #ifndef MYSQL_CLIENT
4780 virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
4782 virtual bool write_data_body(
IO_CACHE *file);
4784 virtual Log_event_type get_type_code() {
return ROWS_QUERY_LOG_EVENT; }
4786 virtual int get_data_size()
4788 return IGNORABLE_HEADER_LEN + 1 + (uint) strlen(m_rows_query);
4790 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4796 char * m_rows_query;
4801 static inline bool copy_event_cache_to_file_and_reinit(
IO_CACHE *cache,
4806 my_b_copy_to_file(cache, file) ||
4807 (flush_stream ? (fflush(file) || ferror(file)) : 0) ||
4808 reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE);
4827 class Heartbeat_log_event:
public Log_event
4830 Heartbeat_log_event(
const char* buf, uint event_len,
4833 bool is_valid()
const
4835 return (log_ident != NULL &&
4836 log_pos >= BIN_LOG_HEADER_SIZE);
4838 const char * get_log_ident() {
return log_ident; }
4839 uint get_ident_len() {
return ident_len; }
4842 const char* log_ident;
4852 bool slave_execute_deferred_events(THD *thd);
4859 extern TYPELIB binlog_checksum_typelib;
4864 #ifndef MYSQL_CLIENT
4873 #ifndef MYSQL_CLIENT
4884 DBUG_ENTER(
"Gtid_log_event::get_type_code()");
4886 ANONYMOUS_GTID_LOG_EVENT : GTID_LOG_EVENT);
4887 DBUG_PRINT(
"info", (
"code=%d=%s", ret,
get_type_str(ret)));
4895 size_t to_string(
char *buf)
const;
4899 void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
4902 bool write_data_header(
IO_CACHE *file);
4905 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
4915 bool is_valid()
const {
return true; }
4942 global_sid_lock->
rdlock();
4947 global_sid_lock->
unlock();
4972 static const char *SET_STRING_PREFIX;
4974 static const size_t SET_STRING_PREFIX_LENGTH= 26;
4976 static const size_t MAX_SET_STRING_LENGTH= SET_STRING_PREFIX_LENGTH +
4980 static const int ENCODED_FLAG_LENGTH= 1;
4984 static const int ENCODED_GNO_LENGTH= 8;
4989 ENCODED_FLAG_LENGTH + ENCODED_SID_LENGTH + ENCODED_GNO_LENGTH;
5007 #ifndef MYSQL_CLIENT
5011 #ifndef MYSQL_CLIENT
5019 Log_event_type get_type_code() {
return PREVIOUS_GTIDS_LOG_EVENT; }
5021 bool is_valid()
const {
return buf != NULL; }
5022 int get_data_size() {
return buf_size; }
5025 void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
5030 if (DBUG_EVALUATE_IF(
"skip_writing_previous_gtids_log_event", 1, 0))
5032 DBUG_PRINT(
"info", (
"skip writing Previous_gtids_log_event because of debug option 'skip_writing_previous_gtids_log_event'"));
5036 if (DBUG_EVALUATE_IF(
"write_partial_previous_gtids_log_event", 1, 0))
5038 DBUG_PRINT(
"info", (
"writing partial Previous_gtids_log_event because of debug option 'write_partial_previous_gtids_log_event'"));
5039 return (Log_event::write_header(file, get_data_size()) ||
5040 Log_event::write_data_header(file));
5043 return (Log_event::write_header(file, get_data_size()) ||
5044 Log_event::write_data_header(file) ||
5045 write_data_body(file) ||
5046 Log_event::write_footer(file));
5048 bool write_data_body(
IO_CACHE *file);
5064 #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
5074 inline bool is_gtid_event(
Log_event* evt)
5076 return (evt->get_type_code() == GTID_LOG_EVENT ||
5077 evt->get_type_code() == ANONYMOUS_GTID_LOG_EVENT);
5080 inline ulong version_product(
const uchar* version_split)
5082 return ((version_split[0] * 256 + version_split[1]) * 256
5083 + version_split[2]);
5094 char *p= version, *r;
5096 for (uint
i= 0;
i<=2;
i++)
5098 number= strtoul(p, &r, 10);
5103 if (number < 256 && (*r ==
'.' ||
i != 0))
5104 split_versions[
i]= (uchar)number;
5107 split_versions[0]= 0;
5108 split_versions[1]= 0;
5109 split_versions[2]= 0;
5124 size_t my_strmov_quoted_identifier(THD *thd,
char *buffer,
5125 const char* identifier,
5128 size_t my_strmov_quoted_identifier(
char *buffer,
const char* identifier);
5130 size_t my_strmov_quoted_identifier_helper(
int q,
char *buffer,
5131 const char* identifier,