#0 trx_sys_get_new_trx_id () at storage/innobase/include/trx0sys.ic:437
#1 0x0000000001b183a7 in trx_start_low (trx=0x7fffed7ce170, read_write=true) at storage/innobase/trx/trx0trx.cc:1407
#2 0x0000000001b1c1ca in trx_start_if_not_started_xa_low (trx=0x7fffed7ce170, read_write=true) at storage/innobase/trx/trx0trx.cc:3059
#3 0x0000000001a4d053 in row_insert_for_mysql_using_ins_graph (mysql_rec=0x7ffe8000fbc0 "\376B", prebuilt=0x7ffe80010160) at storage/innobase/row/row0mysql.cc
:1713
#4 0x0000000001a4d69b in row_insert_for_mysql (mysql_rec=0x7ffe8000fbc0 "\376B", prebuilt=0x7ffe80010160) at storage/innobase/row/row0mysql.cc:1859
#5 0x00000000018f4e92 in ha_innobase::write_row (this=0x7ffe8000f8d0, record=0x7ffe8000fbc0 "\376B") at storage/innobase/handler/ha_innodb.cc:7603
#6 0x0000000000f76f2a in handler::ha_write_row (this=0x7ffe8000f8d0, buf=0x7ffe8000fbc0 "\376B") at sql/handler.cc:8086
#7 0x000000000178cda2 in write_record (thd=0x7ffe80000bc0, table=0x7ffe8000ef10, info=0x7fffec494330, update=0x7fffec4942b0) at sql/sql_insert.cc:1882
#8 0x0000000001789f8a in Sql_cmd_insert::mysql_insert (this=0x7ffe80006a78, thd=0x7ffe80000bc0, table_list=0x7ffe800064e8) at sql/sql_insert.cc:769
#9 0x0000000001790862 in Sql_cmd_insert::execute (this=0x7ffe80006a78, thd=0x7ffe80000bc0) at sql/sql_insert.cc:3127
#10 0x000000000156d9db in mysql_execute_command (thd=0x7ffe80000bc0, first_level=true) at sql/sql_parse.cc:3596
#11 0x00000000015733d9 in mysql_parse (thd=0x7ffe80000bc0, parser_state=0x7fffec495680) at sql/sql_parse.cc:5570
#12 0x0000000001568a58 in dispatch_command (thd=0x7ffe80000bc0, com_data=0x7fffec495e10, command=COM_QUERY) at sql/sql_parse.cc:1484
trx_id_t
420| trx_sys_get_new_trx_id()
421| /*====================*/
422| {
423| ut_ad(trx_sys_mutex_own());
424|
425| /* VERY important: after the database is started, max_trx_id value is
426| divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if
427| will evaluate to TRUE when this function is first time called,
428| and the value for trx id will be written to disk-based header!
429| Thus trx id values will not overlap when the database is
430| repeatedly started! */
431|
432| if (!(trx_sys->max_trx_id % TRX_SYS_TRX_ID_WRITE_MARGIN)) {
433| /*一段txt的磁盘保存*/
434| trx_sys_flush_max_trx_id();
435| }
436| /*获取最大值*/
437+> return(trx_sys->max_trx_id++);
438| }
mysql更新事务创建trx->id 的流程
最新推荐文章于 2024-05-26 15:41:16 发布