mysql insert json 大数据写redo日志的流程
0 mlog_write_string (ptr=0x7fff8cedc02e "", str=0x7ffe781df860 "", len=16330, mtr=0x7fffec491790) at storage/innobase/mtr/mtr0log.cc:322
#1 0x0000000001b66943 in btr_store_big_rec_extern_fields (pcur=0x7fffec491df0, upd=0x0, offsets=0x7fffec4924c0, big_rec_vec=0x7ffe781ec160, btr_mtr=0x7fffec491ef0, op=BTR_STORE_INSERT) at storage/innobase/btr/btr0cur.cc:7114
#2 0x0000000001a2dc7b in row_ins_index_entry_big_rec_func (entry=0x7ffe7800b630, big_rec=0x7ffe781ec160, offsets=0x7fffec4924c0, heap=0x7fffec4927e8, index=0x7ffe88943a50, file=0x229d800 "storage/innobase/row/row0ins.cc", thd=0x7ffe78000bc0, line=2647) at storage/innobase/row/row0ins.cc:3218
#3 0x0000000001a2c1eb in row_ins_clust_index_entry_low (flags=0, mode=2, index=0x7ffe88943a50, n_uniq=1, entry=0x7ffe7800b630, n_ext=0, thr=0x7ffe781be760, dup_chk_only=false) at storage/innobase/row/row0ins.cc:2644
#4 0x0000000001a2df0e in row_ins_clust_index_entry (index=0x7ffe88943a50, entry=0x7ffe7800b630, thr=0x7ffe781be760, n_ext=0, dup_chk_only=false) at storage/innobase/row/row0ins.cc:3291
#5 0x0000000001a2e3fd in row_ins_index_entry (index=0x7ffe88943a50, entry=0x7ffe7800b630, thr=0x7ffe781be760) at storage/innobase/row/row0ins.cc:3429
#6 0x0000000001a2e956 in row_ins_index_entry_step (node=0x7ffe781be0c8, thr=0x7ffe781be760) at storage/innobase/row/row0ins.cc:3579
#7 0x0000000001a2ecc5 in row_ins (node=0x7ffe781be0c8, thr=0x7ffe781be760) at storage/innobase/row/row0ins.cc:3717
#8 0x0000000001a2f122 in row_ins_step (thr=0x7ffe781be760) at storage/innobase/row/row0ins.cc:3853
#9 0x0000000001a4d134 in row_insert_for_mysql_using_ins_graph (mysql_rec=0x7ffe780116c0 "", prebuilt=0x7ffe781bd860) at storage/innobase/row/row0mysql.cc:1738
#10 0x0000000001a4d69b in row_insert_for_mysql (mysql_rec=0x7ffe780116c0 "", prebuilt=0x7ffe781bd860) at storage/innobase/row/row0mysql.cc:1859
#11 0x00000000018f4e92 in ha_innobase::write_row (this=0x7ffe780112b0, record=0x7ffe780116c0 "") at storage/innobase/handler/ha_innodb.cc:7603
#12 0x0000000000f76f2a in handler::ha_write_row (this=0x7ffe780112b0, buf=0x7ffe780116c0 "") at sql/handler.cc:8086
#13 0x000000000178cda2 in write_record (thd=0x7ffe78000bc0, table=0x7ffe780108f0, info=0x7fffec494120, update=0x7fffec4940a0) at sql/sql_insert.cc:1882
#14 0x0000000001789f8a in Sql_cmd_insert::mysql_insert (this=0x7ffe781bc3d0, thd=0x7ffe78000bc0, table_list=0x7ffe781ba938) at sql/sql_insert.cc:769
#15 0x0000000001790862 in Sql_cmd_insert::execute (this=0x7ffe781bc3d0, thd=0x7ffe78000bc0) at sql/sql_insert.cc:3127
#16 0x000000000156d9db in mysql_execute_command (thd=0x7ffe78000bc0, first_level=true) at sql/sql_parse.cc:3596
#17 0x00000000015a9fd4 in Prepared_statement::execute (this=0x7ffe7800e510, expanded_query=0x7fffec495500, open_cursor=false) at sql/sql_prepare.cc:3977
#18 0x00000000015a8dfb in Prepared_statement::execute_loop (this=0x7ffe7800e510, expanded_query=0x7fffec495500, open_cursor=false, packet=0x7ffe781d283a "", packet_end=0x7ffe781df0a8 "") at /roo
t/mysql-5.7.27_edit_malloc_log/sql/sql_prepare.cc:3585
#19 0x00000000015a6784 in mysqld_stmt_execute (thd=0x7ffe78000bc0, stmt_id=1, flags=0, params=0x7ffe781d283a "", params_length=51310) at sql/sql_prepare.cc:2573
#20 0x00000000015686b6 in dispatch_command (thd=0x7ffe78000bc0, com_data=0x7fffec495e10, command=COM_STMT_EXECUTE) at sql/sql_parse.cc:1418
#21 0x00000000015678a4 in do_command (thd=0x7ffe78000bc0) at sql/sql_parse.cc:1025
/*编辑大字段*/
/********************************************************//**
312| Writes a string to a file page buffered in the buffer pool. Writes the
313| corresponding log record to the mini-transaction log. */
314| void
315| mlog_write_string(
316| /*==============*/
317| byte* ptr, /*!< in: pointer where to write */
318| const byte* str, /*!< in: string to write */
319| ulint len, /*!< in: string length */
320| mtr_t* mtr) /*!< in: mini-transaction handle */
321| {
322+> ut_ad(ptr && mtr);
323| ut_a(len < UNIV_PAGE_SIZE);
324|
325| memcpy(ptr, str, len);
326|
327| mlog_log_string(ptr, len, mtr);
328| }
/********************************************************//**
331| Logs a write of a string to a file page buffered in the buffer pool.
332| Writes the corresponding log record to the mini-transaction log. */
333| void
334| mlog_log_string(
335| /*============*/
336| byte* ptr, /*!< in: pointer written to */
337| ulint len, /*!< in: string length */
338| mtr_t* mtr) /*!< in: mini-transaction handle */
339| {
340| byte* log_ptr;
341|
342| ut_ad(ptr && mtr);
343| ut_ad(len <= UNIV_PAGE_SIZE);
344|
345| log_ptr = mlog_open(mtr, 30);
346|
347| /* If no logging is requested, we may return now */
348| if (log_ptr == NULL) {
349|
350| return;
351| }
352|
353| log_ptr = mlog_write_initial_log_record_fast(ptr, MLOG_WRITE_STRING,
354| log_ptr, mtr);
355| mach_write_to_2(log_ptr, page_offset(ptr));
356+> log_ptr += 2;
357|
358| mach_write_to_2(log_ptr, len);
359| log_ptr += 2;
360|
361| mlog_close(mtr, log_ptr);
362|
363| mlog_catenate_string(mtr, ptr, len);
364| }
mysql insert json 大数据写redo日志的流程
最新推荐文章于 2023-02-03 23:06:29 发布