In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "Why the post-begin transaction in MySQL is not submitted". In the daily operation, I believe that many people have doubts about why the post-begin transaction is not submitted in MySQL. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "Why not commit post-begin transaction in MySQL". Next, please follow the editor to study!
By the way today, the main process is to track why things are not submitted after begin, and finally find out that in:
This judgment is included in the MYSQL_BIN_LOG::commit function
If (! cache_mngr- > trx_cache.is_binlog_empty () & & ending_trans (thd, all) & &! trx_stuff_logged)
If begin, ending_trans (thd, all) will return as false, and the order_commit process will not be invoked.
Then its main judgment is:
Bool ending_single_stmt_trans (THD* thd, const bool all) {return (! all & &! thd- > in_multi_stmt_transaction_mode ());}
Here are the source code comments and functions:
Returns TRUE if session is in a multi-statement transaction mode. OPTION_NOT_AUTOCOMMIT: When autocommit is off, a multi-statement transaction is implicitly started on the first statement after a previous transaction has been ended. OPTION_BEGIN: Regardless of the autocommit status, a multi-statement transaction can be explicitly started with the statements "START TRANSACTION", "BEGIN [WORK]", "[COMMIT | ROLLBACK] AND CHAIN", etc. Note: this doesn't tell you whether a transaction is active. A session can be in multi-statement transaction mode, and yet have no active transaction, e.g., in case of: set @ @ autocommit=0; set @ a = 3
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.