Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the process of generating and writing database transaction Event

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the process of generating and writing database transaction Event". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the process of generating and writing database transaction Event".

1. Query_log_event stack frame:

Initialization

# 0 Query_log_event::Query_log_event (this=0x7fffec0f30d0, thd_arg=0x7ffe7c000b70, query_arg=0x22e0614 "BEGIN", query_length=5, using_trans=true, immediate=false, suppress_use=true, errcode=0, ignore_cmd_internals=true, _ _ in_chrg=, _ _ vtt_parm=) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/log_event.cc:4036#1 0x000000000188cc49 in binlog_start_trans_and_stmt (thd=0x7ffe7c000b70 Start_event=0x7fffec0f4290) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:10387#2 0x000000000188ce88 in THD::binlog_write_table_map (this=0x7ffe7c000b70, table=0x7ffe7c9b8390, is_transactional=true Binlog_rows_query=false) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:10430#3 0x0000000000f8fbe7 in write_locked_table_maps (thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8258#4 0x0000000000f8fe2b in binlog_log_row (table=0x7ffe7c9b8390, before_record=0x7ffe7c9b77e0 "\ 375\ 001", after_record=0x0 Log_func=0xf95805) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8327#5 0x0000000000f90f90 in handler::ha_delete_row (this=0x7ffe7c9bb110, buf=0x7ffe7c9b77e0 "\ 375\ 001") at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8549#6 0x00000000017f41f7 in Sql_cmd_delete::mysql_delete (this=0x7ffe7c006c60, thd=0x7ffe7c000b70 Limit=3) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_delete.cc:468#7 0x00000000017f7180 in Sql_cmd_delete::execute (this=0x7ffe7c006c60, thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_delete.cc:1386#8 0x00000000015cc8e9 in mysql_execute_command (thd=0x7ffe7c000b70 First_level=true) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:3756#9 0x00000000015d30c6 in mysql_parse (thd=0x7ffe7c000b70, parser_state=0x7fffec0f6600) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5901#10 0x00000000015c6c5a in dispatch_command (thd=0x7ffe7c000b70, com_data=0x7fffec0f6d70) Command=COM_QUERY) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1490#11 0x00000000015c59e7 in do_command (thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1021#12 0x000000000170e660 in handle_connection (arg=0x67de900) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/conn_handler/connection_handler_per_thread.cc: 312-13 0x0000000001945620 in pfs_spawn_thread (arg=0x675f7e0) at / root/mysqlall/percona-server-locks-detail-5.7.22/storage/perfschema/pfs.cc:2190#14 0x00007ffff7bc6aa1 in start_thread () from / lib64/libpth II, Table_map_log_event stack frame:

Initialization

# 0 Table_map_log_event::Table_map_log_event (this=0x7fffec0f41f0, thd_arg=0x7ffe7c000b70, tbl=0x7ffe7c9b8390, tid=..., using_trans=true) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/log_event.cc:12045#1 0x000000000188ce68 in THD::binlog_write_table_map (this=0x7ffe7c000b70, table=0x7ffe7c9b8390, is_transactional=true) Binlog_rows_query=false) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:10428#2 0x0000000000f8fbe7 in write_locked_table_maps (thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8258#3 0x0000000000f8fe2b in binlog_log_row (table=0x7ffe7c9b8390, before_record=0x7ffe7c9b77e0 "\ 375\ 001", after_record=0x0 Log_func=0xf95805) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8327#4 0x0000000000f90f90 in handler::ha_delete_row (this=0x7ffe7c9bb110, buf=0x7ffe7c9b77e0 "\ 375\ 001") at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8549#5 0x00000000017f41f7 in Sql_cmd_delete::mysql_delete (this=0x7ffe7c006c60, thd=0x7ffe7c000b70 Limit=3) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_delete.cc:468#6 0x00000000017f7180 in Sql_cmd_delete::execute (this=0x7ffe7c006c60, thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_delete.cc:1386#7 0x00000000015cc8e9 in mysql_execute_command (thd=0x7ffe7c000b70 First_level=true) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:3756#8 0x00000000015d30c6 in mysql_parse (thd=0x7ffe7c000b70, parser_state=0x7fffec0f6600) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5901#9 0x00000000015c6c5a in dispatch_command (thd=0x7ffe7c000b70, com_data=0x7fffec0f6d70) Command=COM_QUERY) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1490#10 0x00000000015c59e7 in do_command (thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1021#11 0x000000000170e660 in handle_connection (arg=0x67de900) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/conn_handler/connection_handler_per_thread.cc: 312 0x0000000001945620 in pfs_spawn_thread (arg=0x675f7e0) at / root/mysqlall/percona-server-locks-detail-5.7.22/storage/perfschema/pfs.cc:2190#13 0x00007ffff7bc6aa1 in start_thread () from / lib64/libpthread.so.0#14 0x00007ffff6719bcd in clone () from / lib64/libc.so.6 III. Delete_rows_log_event

Delete_rows_log_event::Delete_rows_log_event

Initialize Event:

# 0 Delete_rows_log_event::Delete_rows_log_event (this=0x7ffe7cdc7a60, thd_arg=0x7ffe7c000b70, tbl_arg=0x7ffe7c9b8390, tid=..., is_transactional=true, extra_row_info=0x0, _ _ in_chrg=, _ _ vtt_parm=) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/log_event.cc:13086#1 0x000000000189687f in THD::binlog_prepare_pending_rows_event (this=0x7ffe7c000b70, table=0x7ffe7c9b8390, serv_id=953340, needed=5, is_transactional=true, hint=0x0 Extra_row_info=0x0) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:11688#2 0x000000000189003b in THD::binlog_delete_row (this=0x7ffe7c000b70, table=0x7ffe7c9b8390, is_trans=true, record=0x7ffe7c9b77e0 "\ 375\ 001", extra_row_info=0x0) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:11963#3 0x0000000000f95844 in Delete_rows_log_event::binlog_row_logging_function (thd=0x7ffe7c000b70, table=0x7ffe7c9b8390, is_transactional=true Before_record=0x7ffe7c9b77e0 "\ 375\ 001", after_record=0x0) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/log_event.h:3722#4 0x0000000000f8fe9e in binlog_log_row (table=0x7ffe7c9b8390, before_record=0x7ffe7c9b77e0 "\ 375\ 001", after_record=0x0, log_func=0xf95805) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8340#5 0x0000000000f90f90 in handler::ha_delete_row (this=0x7ffe7c9bb110 Buf=0x7ffe7c9b77e0 "\ 375\ 001") at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8549#6 0x00000000017f41f7 in Sql_cmd_delete::mysql_delete (this=0x7ffe7c006c60, thd=0x7ffe7c000b70, limit=3) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_delete.cc:468#7 0x00000000017f7180 in Sql_cmd_delete::execute (this=0x7ffe7c006c60 Thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_delete.cc:1386#8 0x00000000015cc8e9 in mysql_execute_command (thd=0x7ffe7c000b70, first_level=true) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:3756#9 0x00000000015d30c6 in mysql_parse (thd=0x7ffe7c000b70, parser_state=0x7fffec0f6600) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5901#10 0x00000000015c6c5a in dispatch_command (thd=0x7ffe7c000b70 Com_data=0x7fffec0f6d70 Command=COM_QUERY) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1490#11 0x00000000015c59e7 in do_command (thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1021#12 0x000000000170e660 in handle_connection (arg=0x67de900) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/conn_handler/connection_handler_per_thread.cc: 312 13 0x0000000001945620 in pfs_spawn_thread (arg=0x675f7e0) at / root/mysqlall/percona-server-locks-detail-5.7.22/storage/perfschema/pfs.cc:2190#14 0x00007ffff7bc6aa1 in start_thread () from / lib64/libpthread.so.0#15 0x00007ffff6719bcd in clone () from / lib64/libc.so.6

Add data to Rows_log_event::do_add_row_data and add this cycle to event.

# 0 Rows_log_event::do_add_row_data (this=0x7ffe7cdc7a60, row_data=0x7ffe7c9b78e0 "\ 376\ 001", length=5) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/log_event.cc:9676#1 0x00000000018929ad in Rows_log_event::add_row_data (this=0x7ffe7cdc7a60, data=0x7ffe7c9b78e0 "\ 376\ 001") Length=5) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/log_event.h:3067#2 0x0000000001890073 in THD::binlog_delete_row (this=0x7ffe7c000b70, table=0x7ffe7c9b8390, is_trans=true, record=0x7ffe7c9b77e0 "\ 375\ 001", extra_row_info=0x0) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/binlog.cc:11968#3 0x0000000000f95844 in Delete_rows_log_event::binlog_row_logging_function (thd=0x7ffe7c000b70, table=0x7ffe7c9b8390, is_transactional=true Before_record=0x7ffe7c9b77e0 "\ 375\ 001", after_record=0x0) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/log_event.h:3722#4 0x0000000000f8fe9e in binlog_log_row (table=0x7ffe7c9b8390, before_record=0x7ffe7c9b77e0 "\ 375\ 001", after_record=0x0, log_func=0xf95805) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8340 # 5 0x0000000000f90f90 in handler::ha_delete_row (this=0x7ffe7c9bb110 Buf=0x7ffe7c9b77e0 "\ 375\ 001") at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/handler.cc:8549#6 0x00000000017f41f7 in Sql_cmd_delete::mysql_delete (this=0x7ffe7c006c60, thd=0x7ffe7c000b70, limit=3) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_delete.cc:468#7 0x00000000017f7180 in Sql_cmd_delete::execute (this=0x7ffe7c006c60 Thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_delete.cc:1386#8 0x00000000015cc8e9 in mysql_execute_command (thd=0x7ffe7c000b70, first_level=true) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:3756#9 0x00000000015d30c6 in mysql_parse (thd=0x7ffe7c000b70, parser_state=0x7fffec0f6600) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:5901#10 0x00000000015c6c5a in dispatch_command (thd=0x7ffe7c000b70 Com_data=0x7fffec0f6d70 Command=COM_QUERY) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1490#11 0x00000000015c59e7 in do_command (thd=0x7ffe7c000b70) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/sql_parse.cc:1021#12 0x000000000170e660 in handle_connection (arg=0x67de900) at / root/mysqlall/percona-server-locks-detail-5.7.22/sql/conn_handler/connection_handler_per_thread.cc: 312 13 0x0000000001945620 in pfs_spawn_thread (arg=0x675f7e0) at / root/mysqlall/percona-server-locks-detail-5.7.22/storage/perfschema/pfs.cc:2190#14 0x00007ffff7bc6aa1 in start_thread () from / lib64/libpthread.so.0#15 0x00007ffff6719bcd in clone () from / lib64/libc.so.6 Thank you for your reading The above is the content of "what is the generation and writing process of database transaction Event". After the study of this article, I believe you have a deeper understanding of what the generation and writing process of database transaction Event is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report