mysql 寫binlog 大字段流程

2021-10-20 18:53:26 字數 4132 閱讀 4984

/*

當寫binlog大於8192既io_cache 的大小時,不寫io_cache 直接寫入檔案pagecache

當io_cache 剩餘空間無法寫入當前binlog時,則先把io_cache 裡的內容寫入直接寫入檔案pagecache

*/#0 _my_b_write (info=

0x2d9b248

840>

, buffer=

0x7ffe801f7487

"p", count=

51372

) at /mysys/mf_iocache.c:

1311

#10x000000000181d3f1 in binlog_event_writer:

:write_event_part (this=

0x7fffec493130

, buf_p=

0x7fffec492fb8

, buf_len_p=

0x7fffec492fb4

, event_len_p=

0x7fffec492fb0

) at /sql/binlog.cc:

1221

#20x00000000018101a6 in mysql_bin_log:

:do_write_cache (this=

0x2d9af00

, cache=

0x7ffe8000c380

, writer=

0x7fffec493130

) at /sql/binlog.cc:

7874

#30x00000000018109ba in mysql_bin_log:

:write_cache (this=

0x2d9af00

, thd=

0x7ffe80000bc0

, cache_data=

0x7ffe8000c378

, writer=

0x7fffec493130

) at /sql/binlog.cc:

8112

#40x00000000018020bb in binlog_cache_data:

:flush (this=

0x7ffe8000c378

, thd=

0x7ffe80000bc0

, bytes_written=

0x7fffec4931c8

, wrote_xid=

0x7fffec493207

) at /sql/binlog.cc:

1726

#50x000000000181d0cd in binlog_cache_mngr:

:flush (this=

0x7ffe8000c1c0

, thd=

0x7ffe80000bc0

, bytes_written=

0x7fffec493208

, wrote_xid=

0x7fffec493207

) at /sql/binlog.cc:

971#6

0x0000000001812d8f in mysql_bin_log:

:flush_thread_caches (this=

0x2d9af00

, thd=

0x7ffe80000bc0

) at /sql/binlog.cc:

8910

#70x0000000001812fb1 in mysql_bin_log:

:process_flush_stage_queue (this=

0x2d9af00

, total_bytes_var=

0x7fffec493328

, rotate_var=

0x7fffec493327

, out_queue_var=

0x7fffec493318

) at /sql/binlog.cc:

8973

#80x000000000181453b in mysql_bin_log:

:ordered_commit (this=

0x2d9af00

, thd=

0x7ffe80000bc0

, all=true, skip_commit=false) at /sql/binlog.cc:

9610

#90x0000000001812c06 in mysql_bin_log:

:commit (this=

0x2d9af00

, thd=

0x7ffe80000bc0

, all=true) at /sql/binlog.cc:

8867

#100x0000000000f68674 in ha_commit_trans (thd=

0x7ffe80000bc0

, all=true, ignore_global_read_lock=false) at /sql/handler.cc:

1799

#110x0000000001666df8 in trans_commit (thd=

0x7ffe80000bc0

) at /sql/transaction.cc:

239#12

0x000000000156fc6f in mysql_execute_command (thd=

0x7ffe80000bc0

, first_level=true) at /sql/sql_parse.cc:

4244

#130x00000000015733d9 in mysql_parse (thd=

0x7ffe80000bc0

, parser_state=

0x7fffec495680

) at /sql/sql_parse.cc:

5570

#140x0000000001568a58 in dispatch_command (thd=

0x7ffe80000bc0

, com_data=

0x7fffec495e10

, command=com_query) at /sql/sql_parse.cc:

1484

#150x00000000015678a4 in do_command (thd=

0x7ffe80000bc0

) at /sql/sql_parse.cc:

1025

#160x00000000016976a5 in handle_connection (arg=

0xfd50ca0

) at /sql/conn_handler/connection_handler_per_thread.cc:

306#17

0x0000000001d37250 in pfs_spawn_thread (arg=

0xfcc5240

) at /storage/perfschema/pfs.cc:

2190

#180x00007ffff7bc6e65 in start_thread (

) from /lib64/libpthread.so.

0#19

0x00007ffff660788d in clone (

) from /lib64/libc.so.

6/*每次寫io_cache時,判斷當io_cache 剩餘空間無法寫入當前binlog時*/

#define my_b_write(info,buffer,count) \

((info)->write_pos + (count) <=(info)->write_end ?\

(memcpy((info)->write_pos, (buffer), (size_t)(count)),\

((info)->write_pos+=(count)),0) : \

(*(info)->write_function)((info),(uchar *)(buffer),(count)))

static

void

init_functions

(io_cache* info)

*/

jdbc處理大字段

方法一,preparedstatement.setcharacterstream int parameterindex,reader reader,int length 但這麼做的弊端是不允許批量提交的。方法二,1 先用connection從資料庫得到乙個clob物件,public static c...

最大欄位和

include include include include include using namespace std 最大欄位和問題描述 給定n個整數 可能為負數 組成的序列a 1 a 2 a 3 a n 求該序列如a i a i 1 a j 的子段和的最大值。當所給的整均為負數時定義子段和為0,...

最大欄位和

1049 最大子段和 難度 基礎題 n個整數組成的序列a 1 a 2 a 3 a n 求該序列如a i a i 1 a j 的連續子段和的最大值。當所給的整數均為負數時和為0。例如 2,11,4,13,5,2,和最大的子段為 11,4,13。和為20。input 第1行 整數序列的長度n 2 n 5...