mysql5.7insert 执行一条语句,在提交前各个阶段生成binlog的流程

#0  my_b_safe_write (info=0x7ff48400c020, Buffer=0x7fffec035e1f "\021RHK`\036@\001", Count=1) at mysys/mf_iocache.c:1447
#1  0x00000000017a7765 in Log_event::wrapper_my_b_safe_write (this=0x7ff48400c3c0, file=0x7ff48400c020, buf=0x7fffec035e1f "\021RHK`\036@\001", size=1) at sql/log_event.cc:1017
#2  0x00000000017c440e in Rows_log_event::write_data_body (this=0x7ff48400c3c0, file=0x7ff48400c020) at sql/log_event.cc:11657
#3  0x00000000017cef35 in Log_event::write (this=0x7ff48400c3c0, file=0x7ff48400c020) at sql/log_event.h:837
#4  0x00000000017dea16 in binlog_cache_data::write_event (this=0x7ff48400c018, thd=0x7ff484000bc0, ev=0x7ff48400c3c0) at sql/binlog.cc:1351
#5  0x00000000017ec96d in MYSQL_BIN_LOG::flush_and_set_pending_rows_event (this=0x2d091c0 <mysql_bin_log>, thd=0x7ff484000bc0, event=0x0, is_transactional=true) at sql/binlog.cc:7413
#6  0x00000000017f7d14 in THD::binlog_flush_pending_rows_event (this=0x7ff484000bc0, stmt_end=true, is_transactional=true) at sql/binlog.cc:12076
#7  0x00000000017f8467 in THD::binlog_query (this=0x7ff484000bc0, qtype=THD::ROW_QUERY_TYPE, query_arg=0x7ff4840218e0 "insert into mytest04()values(?"..., query_len=302, is_trans=true, direct=false, suppress_use=false, errcode=0) at sql/binlog.cc:12350
#8  0x00000000017679ff in Sql_cmd_insert::mysql_insert (this=0x7ff4840118e0, thd=0x7ff484000bc0, table_list=0x7ff48400fee8) at sql/sql_insert.cc:866
#9  0x000000000176dfbc in Sql_cmd_insert::execute (this=0x7ff4840118e0, thd=0x7ff484000bc0) at sql/sql_insert.cc:3142
#10 0x00000000015498a2 in mysql_execute_command (thd=0x7ff484000bc0, first_level=true) at sql/sql_parse.cc:3606
#11 0x0000000001585fb4 in Prepared_statement::execute (this=0x7ff484023c00, expanded_query=0x7fffec0383c0, open_cursor=false) at sql/sql_prepare.cc:3996
#12 0x0000000001584ddb in Prepared_statement::execute_loop (this=0x7ff484023c00, expanded_query=0x7fffec0383c0, open_cursor=false, packet=0x7ff4841c942a "", packet_end=0x7ff4841d5c8e "") at sql/sql_prepare.cc:3604
#13 0x0000000001582758 in mysqld_stmt_execute (thd=0x7ff484000bc0, stmt_id=1, flags=0, params=0x7ff4841c942a "", params_length=51300) at sql/sql_prepare.cc:2592
#14 0x000000000154456c in dispatch_command (thd=0x7ff484000bc0, com_data=0x7fffec038cd0, command=COM_STMT_EXECUTE) at sql/sql_parse.cc:1425
#15 0x000000000154375f in do_command (thd=0x7ff484000bc0) at sql/sql_parse.cc:1032
#16 0x0000000001674bff in handle_connection (arg=0x804a9a40) at sql/conn_handler/connection_handler_per_thread.cc:313
#17 0x0000000001d12378 in pfs_spawn_thread (arg=0x80497920) at storage/perfschema/pfs.cc:2197
#18 0x00007ffff7bc6e65 in start_thread () from /lib64/libpthread.so.0
#19 0x00007ffff5f3288d in clone () from /lib64/libc.so.6




gdb) where
#0  MYSQL_BIN_LOG::flush_and_set_pending_rows_event (this=0x2d091c0 <mysql_bin_log>, thd=0x7ff484000bc0, event=0x7ff48400c3c0, is_transactional=true) at sql/binlog.cc:7394
#1  0x00000000017fd5e5 in THD::binlog_prepare_pending_rows_event<Write_rows_log_event> (this=0x7ff484000bc0, table=0x7ff4841c5d70, serv_id=320, needed=51357, is_transactional=true, hint=0x0, extra_row_info=0x0) at sql/binlog.cc:11708
#2  0x00000000017f7242 in THD::binlog_write_row (this=0x7ff484000bc0, table=0x7ff4841c5d70, is_trans=true, record=0x7ff4841c6730 "", extra_row_info=0x0) at sql/binlog.cc:11866
#3  0x0000000000f5616b in Write_rows_log_event::binlog_row_logging_function (thd=0x7ff484000bc0, table=0x7ff4841c5d70, is_transactional=true, before_record=0x0, after_record=0x7ff4841c6730 "") at sql/log_event.h:3433
#4  0x0000000000f50c34 in binlog_log_row (table=0x7ff4841c5d70, before_record=0x0, after_record=0x7ff4841c6730 "", log_func=0xf56130 <Write_rows_log_event::binlog_row_logging_function(THD*, TABL
E*, bool, unsigned char const*, unsigned char const*)>) at sql/handler.cc:8024
#5  0x0000000000f5150f in handler::ha_write_row (this=0x7ff484018620, buf=0x7ff4841c6730 "") at sql/handler.cc:8157
#6  0x000000000176a4c1 in write_record (thd=0x7ff484000bc0, table=0x7ff4841c5d70, info=0x7fffec036fe0, update=0x7fffec036f60) at sql/sql_insert.cc:1895
#7  0x000000000176769a in Sql_cmd_insert::mysql_insert (this=0x7ff4840118e0, thd=0x7ff484000bc0, table_list=0x7ff48400fee8) at sql/sql_insert.cc:776
#8  0x000000000176dfbc in Sql_cmd_insert::execute (this=0x7ff4840118e0, thd=0x7ff484000bc0) at sql/sql_insert.cc:3142
#9  0x00000000015498a2 in mysql_execute_command (thd=0x7ff484000bc0, first_level=true) at sql/sql_parse.cc:3606
#10 0x0000000001585fb4 in Prepared_statement::execute (this=0x7ff484023c00, expanded_query=0x7fffec0383c0, open_cursor=false) at sql/sql_prepare.cc:3996
#11 0x0000000001584ddb in Prepared_statement::execute_loop (this=0x7ff484023c00, expanded_query=0x7fffec0383c0, open_cursor=false, packet=0x7ff4841c942a "", packet_end=0x7ff4841d5c8e "") at sql/sql_prepare.cc:3604
#12 0x0000000001582758 in mysqld_stmt_execute (thd=0x7ff484000bc0, stmt_id=1, flags=0, params=0x7ff4841c942a "", params_length=51300) at sql/sql_prepare.cc:2592
#13 0x000000000154456c in dispatch_command (thd=0x7ff484000bc0, com_data=0x7fffec038cd0, command=COM_STMT_EXECUTE) at sql/sql_parse.cc:1425
#14 0x000000000154375f in do_command (thd=0x7ff484000bc0) at sql/sql_parse.cc:1032
#15 0x0000000001674bff in handle_connection (arg=0x804a9a40) at sql/conn_handler/connection_handler_per_thread.cc:313
#16 0x0000000001d12378 in pfs_spawn_thread (arg=0x80497920) at storage/perfschema/pfs.cc:2197
#17 0x00007ffff7bc6e65 in start_thread () from /lib64/libpthread.so.0
#18 0x00007ffff5f3288d in clone () from /lib64/libc.so.6
(gdb) 

#0  THD::binlog_query (this=0x7ff484000bc0, qtype=THD::ROW_QUERY_TYPE, query_arg=0x7ff4840218e0 "insert into mytest04(msisdn,fav_brand,fav_big_type,fav_type,flag_code,fav_order,fav_period,free_v
alue,start_time,end_time,group_id,free_value2,product_code,end_time2,marktmp,marktmp2,marktmp3)values(?"..., query_len=302, is_trans=true, direct=false, suppress_use=false, errcode=0) at /root/b
inloginredo/NestDB/sql/binlog.cc:12326
#1  0x00000000017679ff in Sql_cmd_insert::mysql_insert (this=0x7ff4840118e0, thd=0x7ff484000bc0, table_list=0x7ff48400fee8) at sql/sql_insert.cc:866
#2  0x000000000176dfbc in Sql_cmd_insert::execute (this=0x7ff4840118e0, thd=0x7ff484000bc0) at sql/sql_insert.cc:3142
#3  0x00000000015498a2 in mysql_execute_command (thd=0x7ff484000bc0, first_level=true) at sql/sql_parse.cc:3606
#4  0x0000000001585fb4 in Prepared_statement::execute (this=0x7ff484023c00, expanded_query=0x7fffec0383c0, open_cursor=false) at sql/sql_prepare.cc:3996
#5  0x0000000001584ddb in Prepared_statement::execute_loop (this=0x7ff484023c00, expanded_query=0x7fffec0383c0, open_cursor=false, packet=0x7ff4841c942a "", packet_end=0x7ff4841d5c8e "") at sql/sql_prepare.cc:3604
#6  0x0000000001582758 in mysqld_stmt_execute (thd=0x7ff484000bc0, stmt_id=1, flags=0, params=0x7ff4841c942a "", params_length=51300) at sql/sql_prepare.cc:2592
#7  0x000000000154456c in dispatch_command (thd=0x7ff484000bc0, com_data=0x7fffec038cd0, command=COM_STMT_EXECUTE) at sql/sql_parse.cc:1425
#8  0x000000000154375f in do_command (thd=0x7ff484000bc0) at sql/sql_parse.cc:1032
#9  0x0000000001674bff in handle_connection (arg=0x804a9a40) at sql/conn_handler/connection_handler_per_thread.cc:313
#10 0x0000000001d12378 in pfs_spawn_thread (arg=0x80497920) at storage/perfschema/pfs.cc:2197
#11 0x00007ffff7bc6e65 in start_thread () from /lib64/libpthread.so.0
#12 0x00007ffff5f3288d in clone () from /lib64/libc.so.6
(gdb) 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值