Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2 parts I and II: VTQ update #8

Closed
midenok opened this issue Sep 8, 2016 · 12 comments
Closed

0.2 parts I and II: VTQ update #8

midenok opened this issue Sep 8, 2016 · 12 comments
Assignees

Comments

@midenok
Copy link

midenok commented Sep 8, 2016

DROP TABLE t1;CREATE TABLE t1(x INT UNSIGNED, y INT UNSIGNED, Sys_start TIMESTAMP(6) GENERATED ALWAYS AS ROW START, Sys_end TIMESTAMP(6) GENERATED ALWAYS AS ROW END, PERIOD FOR SYSTEM_TIME (Sys_start, Sys_end)) WITH SYSTEM VERSIONING ENGINE InnoDB;

Single-statement transaction

INSERT INTO t1(x, y) VALUES(8001, 9001);
#0  mtr_commit (mtr=0x7fa9d9bc4530) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0mtr.cc:315
#1  0x0000000000c526a4 in trx_commit_low (trx=0x7fa9b0101678, mtr=0x7fa9d9bc4530) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1645
#2  0x0000000000c5275d in trx_commit (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1673
#3  0x0000000000c5312a in trx_commit_for_mysql (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1937
#4  0x0000000000aac1d4 in innobase_commit_low (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4342
#5  0x0000000000aac4d2 in innobase_commit_ordered_2 (trx=0x7fa9b0101678, thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4486
#6  0x0000000000aac8dc in innobase_commit (hton=0x7fa9d6c5a870, thd=0x7fa9b0016070, commit_trx=0x0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4623
#7  0x00000000008e7097 in commit_one_phase_2 (thd=0x7fa9b0016070, all=0x0, trans=0x7fa9b00191d0, is_real_trans=0x1) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1552
#8  0x00000000008e6f93 in ha_commit_one_phase (thd=0x7fa9b0016070, all=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1533
#9  0x00000000008e686d in ha_commit_trans (thd=0x7fa9b0016070, all=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1400
#10 0x00000000007e24e8 in trans_commit_stmt (thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/sql/transaction.cc:434
#11 0x000000000069ad86 in mysql_execute_command (thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:6135
#12 0x000000000069f205 in mysql_parse (thd=0x7fa9b0016070, rawbuf=0x7fa9b005e088 "INSERT INTO t1(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7fa9d9bc5f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789

Multi-statement transaction

start transaction; INSERT INTO t1(x, y) VALUES(8001, 9001); commit;
#0  mtr_commit (mtr=0x7fa9d9bc4530) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0mtr.cc:315
#1  0x0000000000c526a4 in trx_commit_low (trx=0x7fa9b0101678, mtr=0x7fa9d9bc4530) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1645
#2  0x0000000000c5275d in trx_commit (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1673
#3  0x0000000000c5312a in trx_commit_for_mysql (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1937
#4  0x0000000000aac1d4 in innobase_commit_low (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4342
#5  0x0000000000aac4d2 in innobase_commit_ordered_2 (trx=0x7fa9b0101678, thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4486
#6  0x0000000000aac8dc in innobase_commit (hton=0x7fa9d6c5a870, thd=0x7fa9b0016070, commit_trx=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4623
#7  0x00000000008e7097 in commit_one_phase_2 (thd=0x7fa9b0016070, all=0x1, trans=0x7fa9b00191b8, is_real_trans=0x1) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1552
#8  0x00000000008e6f93 in ha_commit_one_phase (thd=0x7fa9b0016070, all=0x1) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1533
#9  0x00000000008e686d in ha_commit_trans (thd=0x7fa9b0016070, all=0x1) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1400
#10 0x00000000007e1c50 in trans_commit (thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/sql/transaction.cc:236
#11 0x000000000069811e in mysql_execute_command (thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:5412
#12 0x000000000069f205 in mysql_parse (thd=0x7fa9b0016070, rawbuf=0x7fa9b005e088 "commit", length=0x6, parser_state=0x7fa9d9bc5f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789

Two-phase transaction

xa start 'xyz'; INSERT INTO t1(x, y) VALUES(8001, 9001); xa end 'xyz'; xa prepare 'xyz'; xa commit 'xyz';
#0  mtr_commit (mtr=0x7fa9d9bc45c0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0mtr.cc:315
#1  0x0000000000c526a4 in trx_commit_low (trx=0x7fa9b0101678, mtr=0x7fa9d9bc45c0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1645
#2  0x0000000000c5275d in trx_commit (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1673
#3  0x0000000000c5312a in trx_commit_for_mysql (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1937
#4  0x0000000000aac1d4 in innobase_commit_low (trx=0x7fa9b0101678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4342
#5  0x0000000000aac4d2 in innobase_commit_ordered_2 (trx=0x7fa9b0101678, thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4486
#6  0x0000000000aac8dc in innobase_commit (hton=0x7fa9d6c5a870, thd=0x7fa9b0016070, commit_trx=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4623
#7  0x00000000008e7097 in commit_one_phase_2 (thd=0x7fa9b0016070, all=0x1, trans=0x7fa9b00191b8, is_real_trans=0x1) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1552
#8  0x00000000008e6f93 in ha_commit_one_phase (thd=0x7fa9b0016070, all=0x1) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1533
#9  0x00000000007e38a4 in trans_xa_commit (thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/sql/transaction.cc:895
#10 0x0000000000699f20 in mysql_execute_command (thd=0x7fa9b0016070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:5951
#11 0x000000000069f205 in mysql_parse (thd=0x7fa9b0016070, rawbuf=0x7fa9b005e088 "xa commit 'xyz'", length=0xf, parser_state=0x7fa9d9bc5f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789
@midenok midenok self-assigned this Sep 8, 2016
@midenok midenok changed the title Detect if commit changes data of versioning tables VTQ update dissection Sep 8, 2016
@midenok
Copy link
Author

midenok commented Sep 9, 2016

INSERT INTO t1(x, y) VALUES(8001, 9001);
#0  mlog_write_initial_log_record (ptr=0x7f46fc380000 "`\240\256|", type=0x18, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0log.cc:78
#1  0x0000000000c57d77 in trx_undo_insert_header_reuse_log (undo_page=0x7f46fc380000 "`\240\256|", trx_id=0xbc08, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtra
db/trx/trx0undo.cc:698
#2  0x0000000000c58006 in trx_undo_insert_header_reuse (undo_page=0x7f46fc380000 "`\240\256|", trx_id=0xbc08, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/t
rx/trx0undo.cc:801
#3  0x0000000000c5a16d in trx_undo_reuse_cached (trx=0x7f46e2901678, rseg=0x7f470986d478, type=0x1, trx_id=0xbc08, xid=0x7f46e2901810, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/ha
grid/src/storage/xtradb/trx/trx0undo.cc:1684
#4  0x0000000000c5a4c7 in trx_undo_assign_undo (trx=0x7f46e2901678, type=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1784
#5  0x0000000000c403fb in trx_undo_report_row_operation (flags=0x0, op_type=0x1, thr=0x7f46e2917838, index=0x7f46e28f8f78, clust_entry=0x7f46e28e8ff8, update=0x0, cmpl_info=0x0, rec=0x0,
 offsets=0x0, roll_ptr=0x7f470c623d70) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0rec.cc:1262
#6  0x0000000000c87ae9 in btr_cur_ins_lock_and_undo (flags=0x0, cursor=0x7f470c623f50, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, mtr=0x7f470c623fd0, inherit=0x7f470c623e08) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1331
#7  0x0000000000c88216 in btr_cur_optimistic_insert (flags=0x0, cursor=0x7f470c623f50, offsets=0x7f470c623f08, heap=0x7f470c623f18, entry=0x7f46e28e8ff8, rec=0x7f470c623f20, big_rec=0x7f470c623f10, n_ext=0x0, thr=0x7f46e2917838, mtr=0x7f470c623fd0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1555
#8  0x0000000000bad884 in row_ins_clust_index_entry_low (flags=0x0, mode=0x2, index=0x7f46e28f8f78, n_uniq=0x0, entry=0x7f46e28e8ff8, n_ext=0x0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:2558
#9  0x0000000000baea1c in row_ins_clust_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, n_ext=0x0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3001
#10 0x0000000000baed2c in row_ins_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3099
#11 0x0000000000baeff0 in row_ins_index_entry_step (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3176
#12 0x0000000000baf312 in row_ins (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3316
#13 0x0000000000baf66c in row_ins_step (thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3441
#14 0x0000000000bc8416 in row_insert_for_mysql (mysql_rec=0x7f46e281e988 "\371A\037", prebuilt=0x7f46e2917078) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0mysql.cc:1375
#15 0x0000000000ab3b2b in ha_innobase::write_row (this=0x7f46e28a8088, record=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:8502
#16 0x00000000008f23bb in handler::ha_write_row (this=0x7f46e28a8088, buf=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:5891
#17 0x00000000006704fc in write_record (thd=0x7f46e2816070, table=0x7f46e28c8870, info=0x7f470c624e20) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:1949
#18 0x000000000066dbb9 in mysql_insert (thd=0x7f46e2816070, table_list=0x7f46e285e180, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:998
#19 0x0000000000693bab in mysql_execute_command (thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:4289
#20 0x000000000069f205 in mysql_parse (thd=0x7f46e2816070, rawbuf=0x7f46e285e088 "INSERT INTO t1(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7f470c625f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789
#0  mlog_catenate_ull_compressed (mtr=0x7f470c6232a0, val=0xbc08) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/include/mtr0log.ic:157
#1  0x0000000000c57d8a in trx_undo_insert_header_reuse_log (undo_page=0x7f46fc380000 "`\240\256|", trx_id=0xbc08, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:700
#2  0x0000000000c58006 in trx_undo_insert_header_reuse (undo_page=0x7f46fc380000 "`\240\256|", trx_id=0xbc08, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:801
#3  0x0000000000c5a16d in trx_undo_reuse_cached (trx=0x7f46e2901678, rseg=0x7f470986d478, type=0x1, trx_id=0xbc08, xid=0x7f46e2901810, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1684
#4  0x0000000000c5a4c7 in trx_undo_assign_undo (trx=0x7f46e2901678, type=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1784
#5  0x0000000000c403fb in trx_undo_report_row_operation (flags=0x0, op_type=0x1, thr=0x7f46e2917838, index=0x7f46e28f8f78, clust_entry=0x7f46e28e8ff8, update=0x0, cmpl_info=0x0, rec=0x0, offsets=0x0, roll_ptr=0x7f470c623d70) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0rec.cc:1262
#6  0x0000000000c87ae9 in btr_cur_ins_lock_and_undo (flags=0x0, cursor=0x7f470c623f50, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, mtr=0x7f470c623fd0, inherit=0x7f470c623e08) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1331
#7  0x0000000000c88216 in btr_cur_optimistic_insert (flags=0x0, cursor=0x7f470c623f50, offsets=0x7f470c623f08, heap=0x7f470c623f18, entry=0x7f46e28e8ff8, rec=0x7f470c623f20, big_rec=0x7f470c623f10, n_ext=0x0, thr=0x7f46e2917838, mtr=0x7f470c623fd0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1555
#8  0x0000000000bad884 in row_ins_clust_index_entry_low (flags=0x0, mode=0x2, index=0x7f46e28f8f78, n_uniq=0x0, entry=0x7f46e28e8ff8, n_ext=0x0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:2558
#9  0x0000000000baea1c in row_ins_clust_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, n_ext=0x0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3001
#10 0x0000000000baed2c in row_ins_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3099
#11 0x0000000000baeff0 in row_ins_index_entry_step (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3176
#12 0x0000000000baf312 in row_ins (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3316
#13 0x0000000000baf66c in row_ins_step (thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3441
#14 0x0000000000bc8416 in row_insert_for_mysql (mysql_rec=0x7f46e281e988 "\371A\037", prebuilt=0x7f46e2917078) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0mysql.cc:1375
#15 0x0000000000ab3b2b in ha_innobase::write_row (this=0x7f46e28a8088, record=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:8502
#16 0x00000000008f23bb in handler::ha_write_row (this=0x7f46e28a8088, buf=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:5891
#17 0x00000000006704fc in write_record (thd=0x7f46e2816070, table=0x7f46e28c8870, info=0x7f470c624e20) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:1949
#18 0x000000000066dbb9 in mysql_insert (thd=0x7f46e2816070, table_list=0x7f46e285e180, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:998
#19 0x0000000000693bab in mysql_execute_command (thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:4289
#20 0x000000000069f205 in mysql_parse (thd=0x7f46e2816070, rawbuf=0x7f46e285e088 "INSERT INTO t1(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7f470c625f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789
#0  mlog_write_ulint (ptr=0x7f46fc380028 "", val=0x110, type=0x2, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0log.cc:265
#1  0x0000000000c57d0b in trx_undo_header_add_space_for_xid (undo_page=0x7f46fc380000 "`\240\256|", log_hdr=0x7f46fc380056 "", mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:679
#2  0x0000000000c5a1a4 in trx_undo_reuse_cached (trx=0x7f46e2901678, rseg=0x7f470986d478, type=0x1, trx_id=0xbc08, xid=0x7f46e2901810, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1688
#3  0x0000000000c5a4c7 in trx_undo_assign_undo (trx=0x7f46e2901678, type=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1784
#4  0x0000000000c403fb in trx_undo_report_row_operation (flags=0x0, op_type=0x1, thr=0x7f46e2917838, index=0x7f46e28f8f78, clust_entry=0x7f46e28e8ff8, update=0x0, cmpl_info=0x0, rec=0x0, offsets=0x0, roll_ptr=0x7f470c623d70) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0rec.cc:1262
#5  0x0000000000c87ae9 in btr_cur_ins_lock_and_undo (flags=0x0, cursor=0x7f470c623f50, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, mtr=0x7f470c623fd0, inherit=0x7f470c623e08) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1331
#6  0x0000000000c88216 in btr_cur_optimistic_insert (flags=0x0, cursor=0x7f470c623f50, offsets=0x7f470c623f08, heap=0x7f470c623f18, entry=0x7f46e28e8ff8, rec=0x7f470c623f20, big_rec=0x7f470c623f10, n_ext=0x0, thr=0x7f46e2917838, mtr=0x7f470c623fd0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1555
#7  0x0000000000bad884 in row_ins_clust_index_entry_low (flags=0x0, mode=0x2, index=0x7f46e28f8f78, n_uniq=0x0, entry=0x7f46e28e8ff8, n_ext=0x0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:2558
#8  0x0000000000baea1c in row_ins_clust_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, n_ext=0x0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3001
#9  0x0000000000baed2c in row_ins_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3099
#10 0x0000000000baeff0 in row_ins_index_entry_step (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3176
#11 0x0000000000baf312 in row_ins (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3316
#12 0x0000000000baf66c in row_ins_step (thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3441
#13 0x0000000000bc8416 in row_insert_for_mysql (mysql_rec=0x7f46e281e988 "\371A\037", prebuilt=0x7f46e2917078) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0mysql.cc:1375
#14 0x0000000000ab3b2b in ha_innobase::write_row (this=0x7f46e28a8088, record=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:8502
#15 0x00000000008f23bb in handler::ha_write_row (this=0x7f46e28a8088, buf=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:5891
#16 0x00000000006704fc in write_record (thd=0x7f46e2816070, table=0x7f46e28c8870, info=0x7f470c624e20) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:1949
#17 0x000000000066dbb9 in mysql_insert (thd=0x7f46e2816070, table_list=0x7f46e285e180, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:998
#18 0x0000000000693bab in mysql_execute_command (thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:4289
#19 0x000000000069f205 in mysql_parse (thd=0x7f46e2816070, rawbuf=0x7f46e285e088 "INSERT INTO t1(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7f470c625f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789
#0  mlog_write_ulint (ptr=0x7f46fc38002a "", val=0x110, type=0x2, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0log.cc:265
#1  0x0000000000c57d2b in trx_undo_header_add_space_for_xid (undo_page=0x7f46fc380000 "`\240\256|", log_hdr=0x7f46fc380056 "", mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:682
#2  0x0000000000c5a1a4 in trx_undo_reuse_cached (trx=0x7f46e2901678, rseg=0x7f470986d478, type=0x1, trx_id=0xbc08, xid=0x7f46e2901810, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1688
#3  0x0000000000c5a4c7 in trx_undo_assign_undo (trx=0x7f46e2901678, type=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1784
#4  0x0000000000c403fb in trx_undo_report_row_operation (flags=0x0, op_type=0x1, thr=0x7f46e2917838, index=0x7f46e28f8f78, clust_entry=0x7f46e28e8ff8, update=0x0, cmpl_info=0x0, rec=0x0, offsets=0x0, roll_ptr=0x7f470c623d70) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0rec.cc:1262
#5  0x0000000000c87ae9 in btr_cur_ins_lock_and_undo (flags=0x0, cursor=0x7f470c623f50, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, mtr=0x7f470c623fd0, inherit=0x7f470c623e08) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1331
#6  0x0000000000c88216 in btr_cur_optimistic_insert (flags=0x0, cursor=0x7f470c623f50, offsets=0x7f470c623f08, heap=0x7f470c623f18, entry=0x7f46e28e8ff8, rec=0x7f470c623f20, big_rec=0x7f470c623f10, n_ext=0x0, thr=0x7f46e2917838, mtr=0x7f470c623fd0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1555
#7  0x0000000000bad884 in row_ins_clust_index_entry_low (flags=0x0, mode=0x2, index=0x7f46e28f8f78, n_uniq=0x0, entry=0x7f46e28e8ff8, n_ext=0x0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:2558
#8  0x0000000000baea1c in row_ins_clust_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, n_ext=0x0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3001
#9  0x0000000000baed2c in row_ins_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3099
#10 0x0000000000baeff0 in row_ins_index_entry_step (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3176
#11 0x0000000000baf312 in row_ins (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3316
#12 0x0000000000baf66c in row_ins_step (thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3441
#13 0x0000000000bc8416 in row_insert_for_mysql (mysql_rec=0x7f46e281e988 "\371A\037", prebuilt=0x7f46e2917078) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0mysql.cc:1375
#14 0x0000000000ab3b2b in ha_innobase::write_row (this=0x7f46e28a8088, record=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:8502
#15 0x00000000008f23bb in handler::ha_write_row (this=0x7f46e28a8088, buf=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:5891
#16 0x00000000006704fc in write_record (thd=0x7f46e2816070, table=0x7f46e28c8870, info=0x7f470c624e20) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:1949
#17 0x000000000066dbb9 in mysql_insert (thd=0x7f46e2816070, table_list=0x7f46e285e180, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:998
#18 0x0000000000693bab in mysql_execute_command (thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:4289
#19 0x000000000069f205 in mysql_parse (thd=0x7f46e2816070, rawbuf=0x7f46e285e088 "INSERT INTO t1(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7f470c625f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789
#0  mlog_write_ulint (ptr=0x7f46fc380068 "", val=0x110, type=0x2, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0log.cc:265
#1  0x0000000000c57d4b in trx_undo_header_add_space_for_xid (undo_page=0x7f46fc380000 "`\240\256|", log_hdr=0x7f46fc380056 "", mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src
/storage/xtradb/trx/trx0undo.cc:685
#2  0x0000000000c5a1a4 in trx_undo_reuse_cached (trx=0x7f46e2901678, rseg=0x7f470986d478, type=0x1, trx_id=0xbc08, xid=0x7f46e2901810, mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/ha
grid/src/storage/xtradb/trx/trx0undo.cc:1688
#3  0x0000000000c5a4c7 in trx_undo_assign_undo (trx=0x7f46e2901678, type=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1784
#4  0x0000000000c403fb in trx_undo_report_row_operation (flags=0x0, op_type=0x1, thr=0x7f46e2917838, index=0x7f46e28f8f78, clust_entry=0x7f46e28e8ff8, update=0x0, cmpl_info=0x0, rec=0x0,
 offsets=0x0, roll_ptr=0x7f470c623d70) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0rec.cc:1262
#5  0x0000000000c87ae9 in btr_cur_ins_lock_and_undo (flags=0x0, cursor=0x7f470c623f50, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, mtr=0x7f470c623fd0, inherit=0x7f470c623e08) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1331
#6  0x0000000000c88216 in btr_cur_optimistic_insert (flags=0x0, cursor=0x7f470c623f50, offsets=0x7f470c623f08, heap=0x7f470c623f18, entry=0x7f46e28e8ff8, rec=0x7f470c623f20, big_rec=0x7f470c623f10, n_ext=0x0, thr=0x7f46e2917838, mtr=0x7f470c623fd0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1555
#7  0x0000000000bad884 in row_ins_clust_index_entry_low (flags=0x0, mode=0x2, index=0x7f46e28f8f78, n_uniq=0x0, entry=0x7f46e28e8ff8, n_ext=0x0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:2558
#8  0x0000000000baea1c in row_ins_clust_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, n_ext=0x0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3001
#9  0x0000000000baed2c in row_ins_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3099
#10 0x0000000000baeff0 in row_ins_index_entry_step (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3176
#11 0x0000000000baf312 in row_ins (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3316
#12 0x0000000000baf66c in row_ins_step (thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3441
#13 0x0000000000bc8416 in row_insert_for_mysql (mysql_rec=0x7f46e281e988 "\371A\037", prebuilt=0x7f46e2917078) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0mysql.cc:1375
#14 0x0000000000ab3b2b in ha_innobase::write_row (this=0x7f46e28a8088, record=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:8502
#15 0x00000000008f23bb in handler::ha_write_row (this=0x7f46e28a8088, buf=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:5891
#16 0x00000000006704fc in write_record (thd=0x7f46e2816070, table=0x7f46e28c8870, info=0x7f470c624e20) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:1949
#17 0x000000000066dbb9 in mysql_insert (thd=0x7f46e2816070, table_list=0x7f46e285e180, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:998
#18 0x0000000000693bab in mysql_execute_command (thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:4289
#19 0x000000000069f205 in mysql_parse (thd=0x7f46e2816070, rawbuf=0x7f46e285e088 "INSERT INTO t1(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7f470c625f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789
#0  mlog_catenate_ulint (mtr=0x7f470c6232a0, val=0x1f, type=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/include/mtr0log.ic:91
#1  0x0000000000b4977e in mtr_log_reserve_and_write (mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0mtr.cc:252
#2  0x0000000000b49a82 in mtr_commit (mtr=0x7f470c6232a0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0mtr.cc:327
#3  0x0000000000c5a67b in trx_undo_assign_undo (trx=0x7f46e2901678, type=0x1) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1811
#4  0x0000000000c403fb in trx_undo_report_row_operation (flags=0x0, op_type=0x1, thr=0x7f46e2917838, index=0x7f46e28f8f78, clust_entry=0x7f46e28e8ff8, update=0x0, cmpl_info=0x0, rec=0x0, offsets=0x0, roll_ptr=0x7f470c623d70) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0rec.cc:1262
#5  0x0000000000c87ae9 in btr_cur_ins_lock_and_undo (flags=0x0, cursor=0x7f470c623f50, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, mtr=0x7f470c623fd0, inherit=0x7f470c623e08) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1331
#6  0x0000000000c88216 in btr_cur_optimistic_insert (flags=0x0, cursor=0x7f470c623f50, offsets=0x7f470c623f08, heap=0x7f470c623f18, entry=0x7f46e28e8ff8, rec=0x7f470c623f20, big_rec=0x7f470c623f10, n_ext=0x0, thr=0x7f46e2917838, mtr=0x7f470c623fd0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/btr/btr0cur.cc:1555
#7  0x0000000000bad884 in row_ins_clust_index_entry_low (flags=0x0, mode=0x2, index=0x7f46e28f8f78, n_uniq=0x0, entry=0x7f46e28e8ff8, n_ext=0x0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:2558
#8  0x0000000000baea1c in row_ins_clust_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838, n_ext=0x0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3001
#9  0x0000000000baed2c in row_ins_index_entry (index=0x7f46e28f8f78, entry=0x7f46e28e8ff8, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3099
#10 0x0000000000baeff0 in row_ins_index_entry_step (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3176
#11 0x0000000000baf312 in row_ins (node=0x7f46e29175c0, thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3316
#12 0x0000000000baf66c in row_ins_step (thr=0x7f46e2917838) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0ins.cc:3441
#13 0x0000000000bc8416 in row_insert_for_mysql (mysql_rec=0x7f46e281e988 "\371A\037", prebuilt=0x7f46e2917078) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/row/row0mysql.cc:1375
#14 0x0000000000ab3b2b in ha_innobase::write_row (this=0x7f46e28a8088, record=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:8502
#15 0x00000000008f23bb in handler::ha_write_row (this=0x7f46e28a8088, buf=0x7f46e281e988 "\371A\037") at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:5891
#16 0x00000000006704fc in write_record (thd=0x7f46e2816070, table=0x7f46e28c8870, info=0x7f470c624e20) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:1949
#17 0x000000000066dbb9 in mysql_insert (thd=0x7f46e2816070, table_list=0x7f46e285e180, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_insert.cc:998
#18 0x0000000000693bab in mysql_execute_command (thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:4289
#19 0x000000000069f205 in mysql_parse (thd=0x7f46e2816070, rawbuf=0x7f46e285e088 "INSERT INTO t1(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7f470c625f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789
#0  mlog_write_ulint (ptr=0x7f46fc380038 "", val=0x2, type=0x2, mtr=0x7f470c624530) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/mtr/mtr0log.cc:265
#1  0x0000000000c5a7e8 in trx_undo_set_state_at_finish (undo=0x7f4709840e38, mtr=0x7f470c624530) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0undo.cc:1859
#2  0x0000000000c51570 in trx_write_serialisation_history (trx=0x7f46e2901678, mtr=0x7f470c624530) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1231
#3  0x0000000000c52698 in trx_commit_low (trx=0x7f46e2901678, mtr=0x7f470c624530) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1626
#4  0x0000000000c5275d in trx_commit (trx=0x7f46e2901678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1673
#5  0x0000000000c5312a in trx_commit_for_mysql (trx=0x7f46e2901678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/trx/trx0trx.cc:1937
#6  0x0000000000aac1d4 in innobase_commit_low (trx=0x7f46e2901678) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4342
#7  0x0000000000aac4d2 in innobase_commit_ordered_2 (trx=0x7f46e2901678, thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4486
#8  0x0000000000aac8dc in innobase_commit (hton=0x7f470985a870, thd=0x7f46e2816070, commit_trx=0x0) at /home/midenok/src/mariadb/hagrid/src/storage/xtradb/handler/ha_innodb.cc:4623
#9  0x00000000008e7097 in commit_one_phase_2 (thd=0x7f46e2816070, all=0x0, trans=0x7f46e28191d0, is_real_trans=0x1) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1552
#10 0x00000000008e6f93 in ha_commit_one_phase (thd=0x7f46e2816070, all=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1533
#11 0x00000000008e686d in ha_commit_trans (thd=0x7f46e2816070, all=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/handler.cc:1400
#12 0x00000000007e24e8 in trans_commit_stmt (thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/sql/transaction.cc:434
#13 0x000000000069ad86 in mysql_execute_command (thd=0x7f46e2816070) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:6135
#14 0x000000000069f205 in mysql_parse (thd=0x7f46e2816070, rawbuf=0x7f46e285e088 "INSERT INTO t1(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7f470c625f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/hagrid/src/sql/sql_parse.cc:7789

@midenok
Copy link
Author

midenok commented Sep 13, 2016

TODO:

  1. check that vers_vtq_table is closed on mysql_execute_command end;
  2. check that memory for vers_vtq is freed on mysql_execute_command end;

@midenok midenok changed the title VTQ update dissection VTQ update Sep 13, 2016
@midenok midenok added this to the 0.2 VTQ Table milestone Sep 13, 2016
@midenok midenok added the task label Sep 13, 2016
@midenok
Copy link
Author

midenok commented Sep 17, 2016

#0  ha_innobase::ha_innobase (this=0x7fc9870a7888, hton=0x7fc9ad45a870, table_arg=0x7fc987096a88) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:2740
#1  0x0000000000bed14b in innobase_create_handler (hton=0x7fc9ad45a870, table=0x7fc987096a88, mem_root=0x7fc987096af8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:1485
#2  0x00000000008e4c9c in get_new_handler (share=0x7fc987096a88, alloc=0x7fc987096af8, db_type=0x7fc9ad45a870) at /home/midenok/src/mariadb/midenok/src/sql/handler.cc:256
#3  0x00000000007856b5 in TABLE_SHARE::init_from_binary_frm_image (this=0x7fc987096a88, thd=0x7fc987016070, write=0x0, frm_image=0x7fc98701da70 "\376\001\t\f\030", frm_length=0x3f8) at /home/midenok/src/mariadb/midenok/src/sql/table.cc:1451
#4  0x000000000078307f in open_table_def (thd=0x7fc987016070, share=0x7fc987096a88, flags=0xb) at /home/midenok/src/mariadb/midenok/src/sql/table.cc:662
#5  0x000000000086857f in tdc_acquire_share (thd=0x7fc987016070, tl=0x7fc9b0125f70, flags=0x3, out_table=0x7fc9b0125618) at /home/midenok/src/mariadb/midenok/src/sql/table_cache.cc:779
#6  0x00000000006246c0 in open_table (thd=0x7fc987016070, table_list=0x7fc9b0125f70, ot_ctx=0x7fc9b0125c20) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.cc:2388
#7  0x00000000006275b1 in open_and_process_table (thd=0x7fc987016070, lex=0x7fc987019a00, tables=0x7fc9b0125f70, counter=0x7fc9b0125cec, flags=0x400, prelocking_strategy=0x7fc9b0125cf0, has_prelocking_list=0x0, ot_ctx=0x7fc9b0125c20) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.cc:4055
#8  0x00000000006286c6 in open_tables (thd=0x7fc987016070, options=..., start=0x7fc9b0125cd0, counter=0x7fc9b0125cec, flags=0x400, prelocking_strategy=0x7fc9b0125cf0) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.cc:4566
#9  0x000000000061fd35 in open_tables (thd=0x7fc987016070, tables=0x7fc9b0125cd0, counter=0x7fc9b0125cec, flags=0x400, prelocking_strategy=0x7fc9b0125cf0) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.h:251
#10 0x0000000000629b84 in open_normal_and_derived_tables (thd=0x7fc987016070, tables=0x7fc9b0125f70, flags=0x400, dt_phases=0x22) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.cc:5291
#11 0x000000000071f0dc in mysqld_list_fields (thd=0x7fc987016070, table_list=0x7fc9b0125f70, wild=0x7fc98705e0a8 "") at /home/midenok/src/mariadb/midenok/src/sql/sql_show.cc:1384
#12 0x000000000068dac2 in dispatch_command (command=COM_FIELD_LIST, thd=0x7fc987016070, packet=0x7fc987052074 "", packet_length=0x3, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:1983
#13 0x000000000068bad2 in do_command (thd=0x7fc987016070) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:1351
#14 0x00000000007cce22 in do_handle_one_connection (connect=0x7fc9ad437ad0) at /home/midenok/src/mariadb/midenok/src/sql/sql_connect.cc:1358
#15 0x00000000007ccb93 in handle_one_connection (arg=0x7fc9ad437ad0) at /home/midenok/src/mariadb/midenok/src/sql/sql_connect.cc:1264
#16 0x00007fc9ae9a26fa in start_thread (arg=0x7fc9b0127700) at pthread_create.c:333
#17 0x00007fc9ae04fb5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

@midenok
Copy link
Author

midenok commented Sep 17, 2016

#0  mlog_write_ulint (ptr=0x7f3e78058028 "", val=0x110, type=0x2, mtr=0x7f3e903652a0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/mtr/mtr0log.cc:265
#1  0x0000000000d86573 in trx_undo_header_add_space_for_xid (undo_page=0x7f3e78058000 "#\231Ҋ", log_hdr=0x7f3e78058056 "", mtr=0x7f3e903652a0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0undo.cc:679
#2  0x0000000000d88a02 in trx_undo_reuse_cached (trx=0x7f3e67497078, rseg=0x7f3e8d440e38, type=0x1, trx_id=0xa506, xid=0x7f3e67497208, mtr=0x7f3e903652a0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0undo.cc:1688
#3  0x0000000000d88d20 in trx_undo_assign_undo (trx=0x7f3e67497078, type=0x1) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0undo.cc:1784
#4  0x0000000000d6fff2 in trx_undo_report_row_operation (flags=0x0, op_type=0x1, thr=0x7f3e67491858, index=0x7f3e6c03dff8, clust_entry=0x7f3e6750b5f8, update=0x0, cmpl_info=0x0, rec=0x0, offsets=0x0, roll_ptr=0x7f3e90365d70) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0rec.cc:1262
#5  0x0000000000db5343 in btr_cur_ins_lock_and_undo (flags=0x0, cursor=0x7f3e90365f50, entry=0x7f3e6750b5f8, thr=0x7f3e67491858, mtr=0x7f3e90365fd0, inherit=0x7f3e90365e08) at /home/midenok/src/mariadb/midenok/src/storage/innobase/btr/btr0cur.cc:1228
#6  0x0000000000db5a00 in btr_cur_optimistic_insert (flags=0x0, cursor=0x7f3e90365f50, offsets=0x7f3e90365f10, heap=0x7f3e90365f20, entry=0x7f3e6750b5f8, rec=0x7f3e90365f28, big_rec=0x7f3e90365f18, n_ext=0x0, thr=0x7f3e67491858, mtr=0x7f3e90365fd0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/btr/btr0cur.cc:1448
#7  0x0000000000ce296e in row_ins_clust_index_entry_low (flags=0x0, mode=0x2, index=0x7f3e6c03dff8, n_uniq=0x2, entry=0x7f3e6750b5f8, n_ext=0x0, thr=0x7f3e67491858) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:2517
#8  0x0000000000ce39f3 in row_ins_clust_index_entry (index=0x7f3e6c03dff8, entry=0x7f3e6750b5f8, thr=0x7f3e67491858, n_ext=0x0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:2928
#9  0x0000000000ce3d03 in row_ins_index_entry (index=0x7f3e6c03dff8, entry=0x7f3e6750b5f8, thr=0x7f3e67491858) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:3026
#10 0x0000000000ce3fc7 in row_ins_index_entry_step (node=0x7f3e674915e0, thr=0x7f3e67491858) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:3103
#11 0x0000000000ce42e9 in row_ins (node=0x7f3e674915e0, thr=0x7f3e67491858) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:3243
#12 0x0000000000ce4643 in row_ins_step (thr=0x7f3e67491858) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:3368
#13 0x0000000000cfc2cc in row_insert_for_mysql (mysql_rec=0x7f3e6741da88 "\375A\037", prebuilt=0x7f3e67491078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:1376
#14 0x0000000000bf8426 in ha_innobase::write_row (this=0x7f3e674a8088, record=0x7f3e6741da88 "\375A\037") at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:8156
#15 0x00000000008f291d in handler::ha_write_row (this=0x7f3e674a8088, buf=0x7f3e6741da88 "\375A\037") at /home/midenok/src/mariadb/midenok/src/sql/handler.cc:5891
#16 0x00000000006705c0 in write_record (thd=0x7f3e67416070, table=0x7f3e674c8870, info=0x7f3e90366e20) at /home/midenok/src/mariadb/midenok/src/sql/sql_insert.cc:1961
#17 0x000000000066dc1f in mysql_insert (thd=0x7f3e67416070, table_list=0x7f3e6745e180, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_insert.cc:1004
#18 0x0000000000693dc1 in mysql_execute_command (thd=0x7f3e67416070) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:4289
#19 0x000000000069f41b in mysql_parse (thd=0x7f3e67416070, rawbuf=0x7f3e6745e088 "INSERT INTO t2(x, y) VALUES(8001, 9001)", length=0x27, parser_state=0x7f3e90367f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:7789

@midenok
Copy link
Author

midenok commented Sep 18, 2016

TODO:

  • VTQ for multi-update

@midenok
Copy link
Author

midenok commented Sep 20, 2016

Delete:

#0  mtr_commit (mtr=0x7f3187a37b40) at /home/midenok/src/mariadb/midenok/src/storage/innobase/mtr/mtr0mtr.cc:312
#1  0x0000000000d3a8f7 in row_upd_clust_rec (node=0x7f315ec927f8, index=0x7f315eca6878, offsets=0x7f3187a37820, offsets_heap=0x7f3187a377d8, thr=0x7f315ec92ad0, mtr=0x7f3187a37b40) at /h
ome/midenok/src/mariadb/midenok/src/storage/innobase/row/row0upd.cc:2379
#2  0x0000000000d3b4d2 in row_upd_clust_step (node=0x7f315ec927f8, thr=0x7f315ec92ad0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0upd.cc:2723
#3  0x0000000000d3b745 in row_upd (node=0x7f315ec927f8, thr=0x7f315ec92ad0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0upd.cc:2813
#4  0x0000000000d3bbbb in row_upd_step (thr=0x7f315ec92ad0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0upd.cc:2965
#5  0x0000000000cfc953 in row_update_for_mysql (mysql_rec=0x7f315ec1c1a0 "\375\001", prebuilt=0x7f315ec92078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:1
812
#6  0x0000000000bf93d4 in ha_innobase::update_row (this=0x7f315ecaf088, old_row=0x7f315ec1c1a0 "\375\001", new_row=0x7f315ec1c188 "\375\001") at /home/midenok/src/mariadb/midenok/src/sto
rage/innobase/handler/ha_innodb.cc:8750
#7  0x00000000008f285d in handler::ha_update_row (this=0x7f315ecaf088, old_data=0x7f315ec1c1a0 "\375\001", new_data=0x7f315ec1c188 "\375\001") at /home/midenok/src/mariadb/midenok/src/sq
l/handler.cc:5923
#8  0x0000000000a5ae4b in TABLE::delete_row (this=0x7f315eccfc70) at /home/midenok/src/mariadb/midenok/src/sql/sql_delete.cc:226
#9  0x0000000000a58586 in mysql_delete (thd=0x7f315ec16070, table_list=0x7f315ec5e150, conds=0x0, order_list=0x7f315ec1a448, limit=0xffffffffffffffff, options=0x0, result=0x0) at /home/m
idenok/src/mariadb/midenok/src/sql/sql_delete.cc:607
#10 0x00000000006946cf in mysql_execute_command (thd=0x7f315ec16070) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:4484
#11 0x000000000069f1cd in mysql_parse (thd=0x7f315ec16070, rawbuf=0x7f315ec5e088 "delete from t1", length=0xe, parser_state=0x7f3187a39f70, is_com_multi=0x0, is_next_command=0x0) at /hom
e/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:7789

Commit:

#0  mtr_commit (mtr=0x7f3187a38530) at /home/midenok/src/mariadb/midenok/src/storage/innobase/mtr/mtr0mtr.cc:312
#1  0x0000000000d80cc9 in trx_commit_low (trx=0x7f315ec97078, mtr=0x7f3187a38530) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:1422
#2  0x0000000000d80d82 in trx_commit (trx=0x7f315ec97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:1450
#3  0x0000000000d81510 in trx_commit_for_mysql (trx=0x7f315ec97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:1672
#4  0x0000000000bf073d in innobase_commit_low (trx=0x7f315ec97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:4064
#5  0x0000000000bf0a3b in innobase_commit_ordered_2 (trx=0x7f315ec97078, thd=0x7f315ec16070) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:4168
#6  0x0000000000bf0db7 in innobase_commit (hton=0x7f3184c5a870, thd=0x7f315ec16070, commit_trx=0x0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:4280
#7  0x00000000008e724b in commit_one_phase_2 (thd=0x7f315ec16070, all=0x0, trans=0x7f315ec191d0, is_real_trans=0x1) at /home/midenok/src/mariadb/midenok/src/sql/handler.cc:1552
#8  0x00000000008e7147 in ha_commit_one_phase (thd=0x7f315ec16070, all=0x0) at /home/midenok/src/mariadb/midenok/src/sql/handler.cc:1533
#9  0x00000000008e6a21 in ha_commit_trans (thd=0x7f315ec16070, all=0x0) at /home/midenok/src/mariadb/midenok/src/sql/handler.cc:1400
#10 0x00000000007e2676 in trans_commit_stmt (thd=0x7f315ec16070) at /home/midenok/src/mariadb/midenok/src/sql/transaction.cc:434
#11 0x000000000069ad4e in mysql_execute_command (thd=0x7f315ec16070) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:6135
#12 0x000000000069f1cd in mysql_parse (thd=0x7f315ec16070, rawbuf=0x7f315ec5e088 "delete from t1", length=0xe, parser_state=0x7f3187a39f70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:7789

@midenok
Copy link
Author

midenok commented Sep 20, 2016

thr->state = QUE_THR_RUNNING;

#0  que_thr_move_to_run_state_for_mysql (thr=0x7fffce9427f0, trx=0x7fffce869878) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:859
#1  0x0000000000cfbeef in row_insert_for_mysql (mysql_rec=0x7fffce81c188 "\375\002", prebuilt=0x7fffce942078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:1370
#2  0x0000000000bf7e7a in ha_innobase::write_row (this=0x7fffce879088, record=0x7fffce81c188 "\375\002") at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:8153
#3  0x00000000008f256f in handler::ha_write_row (this=0x7fffce879088, buf=0x7fffce81c188 "\375\002") at /home/midenok/src/mariadb/midenok/src/sql/handler.cc:5891
#4  0x00000000006704be in write_record (thd=0x7fffce8ba070, table=0x7fffce899870, info=0x7ffff7f7be20) at /home/midenok/src/mariadb/midenok/src/sql/sql_insert.cc:1951
#5  0x000000000066db7b in mysql_insert (thd=0x7fffce8ba070, table_list=0x7fffce910168, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_insert.cc:999
#6  0x0000000000693b73 in mysql_execute_command (thd=0x7fffce8ba070) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:4289
#7  0x000000000069f1cd in mysql_parse (thd=0x7fffce8ba070, rawbuf=0x7fffce910088 "insert into t1 values (2)", length=0x19, parser_state=0x7ffff7f7cf70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:7789

thr->state = QUE_THR_COMPLETED;

#0  que_thr_stop_for_mysql_no_error (thr=0x7f77700fd7f0, trx=0x7f7770097078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:890
#1  0x0000000000cfc1b9 in row_insert_for_mysql (mysql_rec=0x7f777001e488 "\375\002", prebuilt=0x7f77700fd078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:1460
#2  0x0000000000bf7e7a in ha_innobase::write_row (this=0x7f77700a8088, record=0x7f777001e488 "\375\002") at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:8153
#3  0x00000000008f256f in handler::ha_write_row (this=0x7f77700a8088, buf=0x7f777001e488 "\375\002") at /home/midenok/src/mariadb/midenok/src/sql/handler.cc:5891
#4  0x00000000006704be in write_record (thd=0x7f7770016070, table=0x7f77700c8870, info=0x7f77991bae20) at /home/midenok/src/mariadb/midenok/src/sql/sql_insert.cc:1951
#5  0x000000000066db7b in mysql_insert (thd=0x7f7770016070, table_list=0x7f777005e168, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_insert.cc:999
#6  0x0000000000693b73 in mysql_execute_command (thd=0x7f7770016070) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:4289
#7  0x000000000069f1cd in mysql_parse (thd=0x7f7770016070, rawbuf=0x7f777005e088 "insert into t1 values (2)", length=0x19, parser_state=0x7f77991bbf70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:7789

@midenok
Copy link
Author

midenok commented Sep 20, 2016

Insert tuple into clustered index:

        *rec = page_cur_tuple_insert(page_cursor, entry, index,
                         offsets, heap, n_ext, mtr);

@midenok
Copy link
Author

midenok commented Sep 20, 2016

Write field to clustered index:

#0  rec_convert_dtuple_to_rec_old (buf=0x7fffce8fe1b8 "\377\377\377\377\377\377\017\377\370\r", '\377' <repeats 35 times>, dtuple=0x7fffce8e99f8, n_ext=0x0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/rem/rem0rec.cc:1088
#1  0x0000000000cc2dc8 in rec_convert_dtuple_to_rec (buf=0x7fffce8fe1b8 "\377\377\377\377\377\377\017\377\370\r", '\377' <repeats 35 times>, index=0x7fffdf2ff4f8, dtuple=0x7fffce8e99f8, n_ext=0x0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/rem/rem0rec.cc:1351
#2  0x0000000000db17b1 in page_cur_tuple_insert (cursor=0x7ffff7f7af58, tuple=0x7fffce8e99f8, index=0x7fffdf2ff4f8, offsets=0x7ffff7f7af10, heap=0x7ffff7f7af20, n_ext=0x0, mtr=0x7ffff7f7afd0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/include/page0cur.ic:282
#3  0x0000000000db5845 in btr_cur_optimistic_insert (flags=0x0, cursor=0x7ffff7f7af50, offsets=0x7ffff7f7af10, heap=0x7ffff7f7af20, entry=0x7fffce8e99f8, rec=0x7ffff7f7af28, big_rec=0x7ffff7f7af18, n_ext=0x0, thr=0x7fffce8fd7f0, mtr=0x7ffff7f7afd0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/btr/btr0cur.cc:1461
#4  0x0000000000ce24f6 in row_ins_clust_index_entry_low (flags=0x0, mode=0x2, index=0x7fffdf2ff4f8, n_uniq=0x1, entry=0x7fffce8e99f8, n_ext=0x0, thr=0x7fffce8fd7f0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:2517
#5  0x0000000000ce357b in row_ins_clust_index_entry (index=0x7fffdf2ff4f8, entry=0x7fffce8e99f8, thr=0x7fffce8fd7f0, n_ext=0x0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:2928
#6  0x0000000000ce388b in row_ins_index_entry (index=0x7fffdf2ff4f8, entry=0x7fffce8e99f8, thr=0x7fffce8fd7f0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:3026
#7  0x0000000000ce3b4f in row_ins_index_entry_step (node=0x7fffce8fd8a0, thr=0x7fffce8fd7f0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:3103
#8  0x0000000000ce3e71 in row_ins (node=0x7fffce8fd8a0, thr=0x7fffce8fd7f0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:3243
#9  0x0000000000ce438a in vers_notify_vtq (thr=0x7fffce8fd7f0, heap=0x7fffce8fd000) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0ins.cc:3438
#10 0x0000000000cfc0ca in row_insert_for_mysql (mysql_rec=0x7fffce81e488 "\375\005", prebuilt=0x7fffce8fd078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:1405
#11 0x0000000000bf7e7a in ha_innobase::write_row (this=0x7fffce8a8088, record=0x7fffce81e488 "\375\005") at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:8153
#12 0x00000000008f256f in handler::ha_write_row (this=0x7fffce8a8088, buf=0x7fffce81e488 "\375\005") at /home/midenok/src/mariadb/midenok/src/sql/handler.cc:5891
#13 0x00000000006704be in write_record (thd=0x7fffce816070, table=0x7fffce8c8870, info=0x7ffff7f7be20) at /home/midenok/src/mariadb/midenok/src/sql/sql_insert.cc:1951
#14 0x000000000066db7b in mysql_insert (thd=0x7fffce816070, table_list=0x7fffce85e168, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_insert.cc:999
#15 0x0000000000693b73 in mysql_execute_command (thd=0x7fffce816070) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:4289
#16 0x000000000069f1cd in mysql_parse (thd=0x7fffce816070, rawbuf=0x7fffce85e088 "insert into t1 values (5)", length=0x19, parser_state=0x7ffff7f7cf70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:7789

@midenok midenok added the info label Sep 20, 2016
@midenok
Copy link
Author

midenok commented Sep 21, 2016

TRX start:

#0  trx_start_low (trx=0x7f34dbc97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:886
#1  0x0000000000d832aa in trx_start_if_not_started_xa_low (trx=0x7f34dbc97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:2260
#2  0x0000000000cfc4a8 in row_insert_for_mysql (mysql_rec=0x7f34dbc1c188 "\375\b", prebuilt=0x7f34dbc92078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:1352
#3  0x0000000000bf7e7a in ha_innobase::write_row (this=0x7f34dbcaf088, record=0x7f34dbc1c188 "\375\b") at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:8153

TRX release:

#0  lock_trx_release_locks (trx=0x7f34dbc97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/lock/lock0lock.cc:7554
#1  0x0000000000d80c6a in trx_commit_in_memory (trx=0x7f34dbc97078, lsn=0x190c7e) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:1219
#2  0x0000000000d816c3 in trx_commit_low (trx=0x7f34dbc97078, mtr=0x7f3504d6e530) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:1429
#3  0x0000000000d81750 in trx_commit (trx=0x7f34dbc97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:1450
#4  0x0000000000d81ede in trx_commit_for_mysql (trx=0x7f34dbc97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/trx/trx0trx.cc:1672
#5  0x0000000000bf073d in innobase_commit_low (trx=0x7f34dbc97078) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:4064
#6  0x0000000000bf0a3b in innobase_commit_ordered_2 (trx=0x7f34dbc97078, thd=0x7f34dbc16070) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:4168
#7  0x0000000000bf0db7 in innobase_commit (hton=0x7f350205a870, thd=0x7f34dbc16070, commit_trx=0x0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:4280

@midenok
Copy link
Author

midenok commented Sep 23, 2016

Create INFORMATION_SCHEMA table:

#0  create_schema_table (thd=0x7fffcdcba070, table_list=0x7fffcdd10290) at /home/midenok/src/mariadb/midenok/src/sql/sql_show.cc:7456
#1  0x00000000007374a5 in mysql_schema_table (thd=0x7fffcdcba070, lex=0x7fffcdcbda00, table_list=0x7fffcdd10290) at /home/midenok/src/mariadb/midenok/src/sql/sql_show.cc:7781
#2  0x0000000000627279 in open_and_process_table (thd=0x7fffcdcba070, lex=0x7fffcdcbda00, tables=0x7fffcdd10290, counter=0x7ffff7f7ba14, flags=0x0, prelocking_strategy=0x7ffff7f7baa0, has_prelocking_list=0x0, ot_ctx=0x7ffff7f7b980) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.cc:3941
#3  0x0000000000628766 in open_tables (thd=0x7fffcdcba070, options=..., start=0x7ffff7f7b9f8, counter=0x7ffff7f7ba14, flags=0x0, prelocking_strategy=0x7ffff7f7baa0) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.cc:4566
#4  0x00000000006299eb in open_and_lock_tables (thd=0x7fffcdcba070, options=..., tables=0x7fffcdd10290, derived=0x1, flags=0x0, prelocking_strategy=0x7ffff7f7baa0) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.cc:5228
#5  0x000000000061d16f in open_and_lock_tables (thd=0x7fffcdcba070, tables=0x7fffcdd10290, derived=0x1, flags=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_base.h:524
#6  0x000000000069b3bd in execute_sqlcom_select (thd=0x7fffcdcba070, all_tables=0x7fffcdd10290) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:6241
#7  0x000000000069125a in mysql_execute_command (thd=0x7fffcdcba070) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:3352
#8  0x000000000069f2bd in mysql_parse (thd=0x7fffcdcba070, rawbuf=0x7fffcdd10088 "show databases", length=0xe, parser_state=0x7ffff7f7cf70, is_com_multi=0x0, is_next_command=0x0) at /home/midenok/src/mariadb/midenok/src/sql/sql_parse.cc:7792

@midenok
Copy link
Author

midenok commented Sep 24, 2016

Example of search with cursor: fts_add_doc_by_id

@midenok midenok changed the title VTQ update 0.2 parts I and II: VTQ update Sep 26, 2016
@midenok midenok mentioned this issue Sep 26, 2016
kevgs added a commit that referenced this issue Jan 11, 2018
==================
WARNING: ThreadSanitizer: data race (pid=12041)
  Write of size 8 at 0x000003949278 by thread T26 (mutexes: write M226445748578513120):
    #0 thd_destructor_proxy storage/innobase/handler/ha_innodb.cc:314:14 (mysqld+0x19b5505)

  Previous read of size 8 at 0x000003949278 by main thread:
    #0 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4180:11 (mysqld+0x1a03404)
    #1 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc5ec73)
    #2 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x134908d)
    #3 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13484f0)
    #4 init_server_components() sql/mysqld.cc:5345:7 (mysqld+0xbf720f)
    #5 mysqld_main(int, char**) sql/mysqld.cc:5940:7 (mysqld+0xbf107d)
    #6 main sql/main.cc:25:10 (mysqld+0xbe971b)

  Location is global 'srv_running' of size 8 at 0x000003949278 (mysqld+0x000003949278)

  Mutex M226445748578513120 is already destroyed.

  Thread T26 (tid=12070, running) created by main thread at:
    #0 pthread_create /home/kevg/fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:992 (mysqld+0xb7a016)
    #1 spawn_thread_noop mysys/psi_noop.c:187:10 (mysqld+0x26fe403)
    #2 inline_mysql_thread_create(unsigned int, unsigned long*, pthread_attr_t const*, void* (*)(void*), void*) include/mysql/psi/mysql_thread.h:1239:11 (mysqld+0x1a1136d)
    #3 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4177:3 (mysqld+0x1a033e5)
    #4 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc5ec73)
    #5 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x134908d)
    #6 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13484f0)
    #7 init_server_components() sql/mysqld.cc:5345:7 (mysqld+0xbf720f)
    #8 mysqld_main(int, char**) sql/mysqld.cc:5940:7 (mysqld+0xbf107d)
    #9 main sql/main.cc:25:10 (mysqld+0xbe971b)

SUMMARY: ThreadSanitizer: data race storage/innobase/handler/ha_innodb.cc:314:14 in thd_destructor_proxy
==================
kevgs added a commit that referenced this issue Jan 21, 2018
==================
WARNING: ThreadSanitizer: data race (pid=12041)
  Write of size 8 at 0x000003949278 by thread T26 (mutexes: write M226445748578513120):
    #0 thd_destructor_proxy storage/innobase/handler/ha_innodb.cc:314:14 (mysqld+0x19b5505)

  Previous read of size 8 at 0x000003949278 by main thread:
    #0 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4180:11 (mysqld+0x1a03404)
    #1 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc5ec73)
    #2 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x134908d)
    #3 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13484f0)
    #4 init_server_components() sql/mysqld.cc:5345:7 (mysqld+0xbf720f)
    #5 mysqld_main(int, char**) sql/mysqld.cc:5940:7 (mysqld+0xbf107d)
    #6 main sql/main.cc:25:10 (mysqld+0xbe971b)

  Location is global 'srv_running' of size 8 at 0x000003949278 (mysqld+0x000003949278)

  Mutex M226445748578513120 is already destroyed.

  Thread T26 (tid=12070, running) created by main thread at:
    #0 pthread_create /home/kevg/fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:992 (mysqld+0xb7a016)
    #1 spawn_thread_noop mysys/psi_noop.c:187:10 (mysqld+0x26fe403)
    #2 inline_mysql_thread_create(unsigned int, unsigned long*, pthread_attr_t const*, void* (*)(void*), void*) include/mysql/psi/mysql_thread.h:1239:11 (mysqld+0x1a1136d)
    #3 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4177:3 (mysqld+0x1a033e5)
    #4 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc5ec73)
    #5 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x134908d)
    #6 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13484f0)
    #7 init_server_components() sql/mysqld.cc:5345:7 (mysqld+0xbf720f)
    #8 mysqld_main(int, char**) sql/mysqld.cc:5940:7 (mysqld+0xbf107d)
    #9 main sql/main.cc:25:10 (mysqld+0xbe971b)

SUMMARY: ThreadSanitizer: data race storage/innobase/handler/ha_innodb.cc:314:14 in thd_destructor_proxy
==================
kevgs added a commit that referenced this issue Jan 21, 2018
WARNING: ThreadSanitizer: data race (pid=27869)
  Atomic write of size 4 at 0x7b4800000c00 by thread T8:
    #0 __tsan_atomic32_exchange llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:589 (mysqld+0xbd4eac)
    #1 TTASEventMutex<GenericPolicy>::exit() storage/innobase/include/ib0mutex.h:467:7 (mysqld+0x1a8d4cb)
    #2 PolicyMutex<TTASEventMutex<GenericPolicy> >::exit() storage/innobase/include/ib0mutex.h:609:10 (mysqld+0x1a7839e)
    #3 fil_validate() storage/innobase/fil/fil0fil.cc:5535:2 (mysqld+0x1abd913)
    #4 fil_validate_skip() storage/innobase/fil/fil0fil.cc:204:9 (mysqld+0x1aba601)
    #5 fil_aio_wait(unsigned long) storage/innobase/fil/fil0fil.cc:5296:2 (mysqld+0x1abbae6)
    #6 io_handler_thread storage/innobase/srv/srv0start.cc:340:3 (mysqld+0x21abe1e)

  Previous read of size 4 at 0x7b4800000c00 by main thread (mutexes: write M1273, write M1271):
    #0 TTASEventMutex<GenericPolicy>::state() const storage/innobase/include/ib0mutex.h:530:10 (mysqld+0x21c66e2)
    #1 sync_array_detect_deadlock(sync_array_t*, sync_cell_t*, sync_cell_t*, unsigned long) storage/innobase/sync/sync0arr.cc:746:14 (mysqld+0x21c1c7a)
    #2 sync_array_wait_event(sync_array_t*, sync_cell_t*&) storage/innobase/sync/sync0arr.cc:465:6 (mysqld+0x21c1708)
    #3 TTASEventMutex<GenericPolicy>::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:516:6 (mysqld+0x1a8c206)
    #4 PolicyMutex<TTASEventMutex<GenericPolicy> >::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:635:10 (mysqld+0x1a782c3)
    #5 fil_mutex_enter_and_prepare_for_io(unsigned long) storage/innobase/fil/fil0fil.cc:1131:3 (mysqld+0x1a9a92e)
    #6 fil_io(IORequest const&, bool, page_id_t const&, page_size_t const&, unsigned long, unsigned long, void*, void*, bool) storage/innobase/fil/fil0fil.cc:5082:2 (mysqld+0x1ab8de2)
    #7 buf_flush_write_block_low(buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1112:3 (mysqld+0x1cb970a)
    #8 buf_flush_page(buf_pool_t*, buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1270:3 (mysqld+0x1cb7d70)
    #9 buf_flush_try_neighbors(page_id_t const&, buf_flush_t, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1493:9 (mysqld+0x1cc9674)
    #10 buf_flush_page_and_try_neighbors(buf_page_t*, buf_flush_t, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:1565:13 (mysqld+0x1cbadf3)
    #11 buf_do_flush_list_batch(buf_pool_t*, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1825:3 (mysqld+0x1cbbcb8)
    #12 buf_flush_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:1895:16 (mysqld+0x1cbb459)
    #13 buf_flush_do_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:2065:2 (mysqld+0x1cbcfe1)
    #14 buf_flush_lists(unsigned long, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:2167:8 (mysqld+0x1cbd5a3)
    #15 log_preflush_pool_modified_pages(unsigned long) storage/innobase/log/log0log.cc:1400:13 (mysqld+0x1eefc3b)
    #16 log_make_checkpoint_at(unsigned long, bool) storage/innobase/log/log0log.cc:1751:10 (mysqld+0x1eefb16)
    #17 buf_dblwr_create() storage/innobase/buf/buf0dblwr.cc:335:2 (mysqld+0x1cd2141)
    #18 innobase_start_or_create_for_mysql() storage/innobase/srv/srv0start.cc:2539:10 (mysqld+0x21b4d8e)
    #19 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4193:8 (mysqld+0x1a5e3d7)
    #20 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc74d33)
    #21 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x1376d5d)
    #22 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13761c0)
    #23 init_server_components() sql/mysqld.cc:5348:7 (mysqld+0xc0d0ff)
    #24 mysqld_main(int, char**) sql/mysqld.cc:5943:7 (mysqld+0xc06f9d)
    #25 main sql/main.cc:25:10 (mysqld+0xbff71b)
kevgs added a commit that referenced this issue Jan 21, 2018
srv_last_monitor_time: make all accesses relaxed atomical

WARNING: ThreadSanitizer: data race (pid=29031)
  Write of size 8 at 0x0000039e48e0 by thread T15:
    #0 srv_monitor_thread storage/innobase/srv/srv0srv.cc:1699:24 (mysqld+0x21a254e)

  Previous write of size 8 at 0x0000039e48e0 by thread T14:
    #0 srv_refresh_innodb_monitor_stats() storage/innobase/srv/srv0srv.cc:1165:24 (mysqld+0x21a3124)
    #1 srv_error_monitor_thread storage/innobase/srv/srv0srv.cc:1836:3 (mysqld+0x21a2d40)

  Location is global 'srv_last_monitor_time' of size 8 at 0x0000039e48e0 (mysqld+0x0000039e48e0)

  Thread T15 (tid=29050, running) created by main thread at:
    #0 pthread_create /home/kevg/fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:992 (mysqld+0xb90016)
    #1 os_thread_create_func(void* (*)(void*), void*, unsigned long*) storage/innobase/os/os0thread.cc:137:12 (mysqld+0x1f50025)
    #2 innobase_start_or_create_for_mysql() storage/innobase/srv/srv0start.cc:2583:46 (mysqld+0x21b50b7)
    #3 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4193:8 (mysqld+0x1a5e3d7)
    #4 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc74d33)
    #5 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x1376d5d)
    #6 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13761c0)
    #7 init_server_components() sql/mysqld.cc:5348:7 (mysqld+0xc0d0ff)
    #8 mysqld_main(int, char**) sql/mysqld.cc:5943:7 (mysqld+0xc06f9d)
    #9 main sql/main.cc:25:10 (mysqld+0xbff71b)
kevgs added a commit that referenced this issue Jan 21, 2018
additionally fix data race which looks like this:

WARNING: ThreadSanitizer: data race (pid=30515)
  Write of size 8 at 0x0000039ee908 by thread T21:
    #0 ib_counter_t<long, 64, counter_indexer_t>::add(unsigned long, long) storage/innobase/include/ut0counter.h:132:16 (mysqld+0x21cd166)
    #1 ib_counter_t<long, 64, counter_indexer_t>::add(long) storage/innobase/include/ut0counter.h:122:34 (mysqld+0x21cc102)
    #2 rw_lock_x_lock_wait_func(rw_lock_t*, unsigned long, long, char const*, unsigned int) storage/innobase/sync/sync0rw.cc:489:38 (mysqld+0x21cb91f)
    #3 rw_lock_x_lock_low(rw_lock_t*, unsigned long, char const*, unsigned int) storage/innobase/sync/sync0rw.cc:538:3 (mysqld+0x21c9339)
    #4 rw_lock_x_lock_func(rw_lock_t*, unsigned long, char const*, unsigned int) storage/innobase/sync/sync0rw.cc:698:6 (mysqld+0x21c8c4d)
    #5 pfs_rw_lock_x_lock_func(rw_lock_t*, unsigned long, char const*, unsigned int) storage/innobase/include/sync0rw.ic:568:3 (mysqld+0x1afbdb4)
    #6 buf_page_get_gen(page_id_t const&, page_size_t const&, unsigned long, buf_block_t*, unsigned long, char const*, unsigned int, mtr_t*, dberr_t*) storage/innobase/buf/buf0buf.cc:4782:3 (mysqld+0x1b04e28)
    #7 btr_cur_search_to_nth_level_func(dict_index_t*, unsigned long, dtuple_t const*, page_cur_mode_t, unsigned long, btr_cur_t*, rw_lock_t*, char const*, unsigned int, mtr_t*, unsigned long) storage/innobase/btr/btr0cur.cc:1312:10 (mysqld+0x1bf362c)
    #8 btr_pcur_open_low(dict_index_t*, unsigned long, dtuple_t const*, page_cur_mode_t, unsigned long, btr_pcur_t*, char const*, unsigned int, unsigned long, mtr_t*) storage/innobase/include/btr0pcur.ic:457:8 (mysqld+0x20eecd0)
    #9 row_search_on_row_ref(btr_pcur_t*, unsigned long, dict_table_t const*, dtuple_t const*, mtr_t*) storage/innobase/row/row0row.cc:1030:3 (mysqld+0x20ee1b4)
    #10 row_purge_reposition_pcur(unsigned long, purge_node_t*, mtr_t*) storage/innobase/row/row0purge.cc:103:23 (mysqld+0x20d7f6f)
    #11 row_purge_reset_trx_id(purge_node_t*, mtr_t*) storage/innobase/row/row0purge.cc:678:6 (mysqld+0x20dcbcd)
    #12 row_purge_record_func(purge_node_t*, unsigned char*, que_thr_t const*, bool) storage/innobase/row/row0purge.cc:1062:4 (mysqld+0x20db46f)
    #13 row_purge(purge_node_t*, unsigned char*, que_thr_t*) storage/innobase/row/row0purge.cc:1111:18 (mysqld+0x20d8aa4)
    #14 row_purge_step(que_thr_t*) storage/innobase/row/row0purge.cc:1190:3 (mysqld+0x20d872c)
    #15 que_thr_step(que_thr_t*) storage/innobase/que/que0que.cc:1055:9 (mysqld+0x1fcfa6f)
    #16 que_run_threads_low(que_thr_t*) storage/innobase/que/que0que.cc:1117:14 (mysqld+0x1fcdd6e)
    #17 que_run_threads(que_thr_t*) storage/innobase/que/que0que.cc:1157:2 (mysqld+0x1fcd908)
    #18 srv_task_execute() storage/innobase/srv/srv0srv.cc:2520:3 (mysqld+0x21a6684)
    #19 srv_worker_thread storage/innobase/srv/srv0srv.cc:2567:7 (mysqld+0x21a6247)

  Previous write of size 8 at 0x0000039ee908 by thread T20:
    #0 ib_counter_t<long, 64, counter_indexer_t>::add(unsigned long, long) storage/innobase/include/ut0counter.h:132:16 (mysqld+0x21cd166)
    #1 ib_counter_t<long, 64, counter_indexer_t>::add(long) storage/innobase/include/ut0counter.h:122:34 (mysqld+0x21cc102)
    #2 rw_lock_x_lock_wait_func(rw_lock_t*, unsigned long, long, char const*, unsigned int) storage/innobase/sync/sync0rw.cc:489:38 (mysqld+0x21cb91f)
    #3 rw_lock_x_lock_low(rw_lock_t*, unsigned long, char const*, unsigned int) storage/innobase/sync/sync0rw.cc:538:3 (mysqld+0x21c9339)
    #4 rw_lock_x_lock_func(rw_lock_t*, unsigned long, char const*, unsigned int) storage/innobase/sync/sync0rw.cc:698:6 (mysqld+0x21c8c4d)
    #5 pfs_rw_lock_x_lock_func(rw_lock_t*, unsigned long, char const*, unsigned int) storage/innobase/include/sync0rw.ic:568:3 (mysqld+0x1afbdb4)
    #6 buf_page_get_gen(page_id_t const&, page_size_t const&, unsigned long, buf_block_t*, unsigned long, char const*, unsigned int, mtr_t*, dberr_t*) storage/innobase/buf/buf0buf.cc:4782:3 (mysqld+0x1b04e28)
    #7 btr_cur_search_to_nth_level_func(dict_index_t*, unsigned long, dtuple_t const*, page_cur_mode_t, unsigned long, btr_cur_t*, rw_lock_t*, char const*, unsigned int, mtr_t*, unsigned long) storage/innobase/btr/btr0cur.cc:1312:10 (mysqld+0x1bf362c)
    #8 btr_pcur_open_low(dict_index_t*, unsigned long, dtuple_t const*, page_cur_mode_t, unsigned long, btr_pcur_t*, char const*, unsigned int, unsigned long, mtr_t*) storage/innobase/include/btr0pcur.ic:457:8 (mysqld+0x20eecd0)
    #9 row_search_on_row_ref(btr_pcur_t*, unsigned long, dict_table_t const*, dtuple_t const*, mtr_t*) storage/innobase/row/row0row.cc:1030:3 (mysqld+0x20ee1b4)
    #10 row_purge_reposition_pcur(unsigned long, purge_node_t*, mtr_t*) storage/innobase/row/row0purge.cc:103:23 (mysqld+0x20d7f6f)
    #11 row_purge_reset_trx_id(purge_node_t*, mtr_t*) storage/innobase/row/row0purge.cc:678:6 (mysqld+0x20dcbcd)
    #12 row_purge_record_func(purge_node_t*, unsigned char*, que_thr_t const*, bool) storage/innobase/row/row0purge.cc:1062:4 (mysqld+0x20db46f)
    #13 row_purge(purge_node_t*, unsigned char*, que_thr_t*) storage/innobase/row/row0purge.cc:1111:18 (mysqld+0x20d8aa4)
    #14 row_purge_step(que_thr_t*) storage/innobase/row/row0purge.cc:1190:3 (mysqld+0x20d872c)
    #15 que_thr_step(que_thr_t*) storage/innobase/que/que0que.cc:1055:9 (mysqld+0x1fcfa6f)
    #16 que_run_threads_low(que_thr_t*) storage/innobase/que/que0que.cc:1117:14 (mysqld+0x1fcdd6e)
    #17 que_run_threads(que_thr_t*) storage/innobase/que/que0que.cc:1157:2 (mysqld+0x1fcd908)
    #18 srv_task_execute() storage/innobase/srv/srv0srv.cc:2520:3 (mysqld+0x21a6684)
    #19 srv_worker_thread storage/innobase/srv/srv0srv.cc:2567:7 (mysqld+0x21a6247)
kevgs added a commit that referenced this issue Jan 31, 2018
srv_last_monitor_time: make all accesses relaxed atomical

WARNING: ThreadSanitizer: data race (pid=12041)
  Write of size 8 at 0x000003949278 by thread T26 (mutexes: write M226445748578513120):
    #0 thd_destructor_proxy storage/innobase/handler/ha_innodb.cc:314:14 (mysqld+0x19b5505)

  Previous read of size 8 at 0x000003949278 by main thread:
    #0 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4180:11 (mysqld+0x1a03404)
    #1 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc5ec73)
    #2 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x134908d)
    #3 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13484f0)
    #4 init_server_components() sql/mysqld.cc:5345:7 (mysqld+0xbf720f)
    #5 mysqld_main(int, char**) sql/mysqld.cc:5940:7 (mysqld+0xbf107d)
    #6 main sql/main.cc:25:10 (mysqld+0xbe971b)

  Location is global 'srv_running' of size 8 at 0x000003949278 (mysqld+0x000003949278)

WARNING: ThreadSanitizer: data race (pid=27869)
  Atomic write of size 4 at 0x7b4800000c00 by thread T8:
    #0 __tsan_atomic32_exchange llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:589 (mysqld+0xbd4eac)
    #1 TTASEventMutex<GenericPolicy>::exit() storage/innobase/include/ib0mutex.h:467:7 (mysqld+0x1a8d4cb)
    #2 PolicyMutex<TTASEventMutex<GenericPolicy> >::exit() storage/innobase/include/ib0mutex.h:609:10 (mysqld+0x1a7839e)
    #3 fil_validate() storage/innobase/fil/fil0fil.cc:5535:2 (mysqld+0x1abd913)
    #4 fil_validate_skip() storage/innobase/fil/fil0fil.cc:204:9 (mysqld+0x1aba601)
    #5 fil_aio_wait(unsigned long) storage/innobase/fil/fil0fil.cc:5296:2 (mysqld+0x1abbae6)
    #6 io_handler_thread storage/innobase/srv/srv0start.cc:340:3 (mysqld+0x21abe1e)

  Previous read of size 4 at 0x7b4800000c00 by main thread (mutexes: write M1273, write M1271):
    #0 TTASEventMutex<GenericPolicy>::state() const storage/innobase/include/ib0mutex.h:530:10 (mysqld+0x21c66e2)
    #1 sync_array_detect_deadlock(sync_array_t*, sync_cell_t*, sync_cell_t*, unsigned long) storage/innobase/sync/sync0arr.cc:746:14 (mysqld+0x21c1c7a)
    #2 sync_array_wait_event(sync_array_t*, sync_cell_t*&) storage/innobase/sync/sync0arr.cc:465:6 (mysqld+0x21c1708)
    #3 TTASEventMutex<GenericPolicy>::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:516:6 (mysqld+0x1a8c206)
    #4 PolicyMutex<TTASEventMutex<GenericPolicy> >::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:635:10 (mysqld+0x1a782c3)
    #5 fil_mutex_enter_and_prepare_for_io(unsigned long) storage/innobase/fil/fil0fil.cc:1131:3 (mysqld+0x1a9a92e)
    #6 fil_io(IORequest const&, bool, page_id_t const&, page_size_t const&, unsigned long, unsigned long, void*, void*, bool) storage/innobase/fil/fil0fil.cc:5082:2 (mysqld+0x1ab8de2)
    #7 buf_flush_write_block_low(buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1112:3 (mysqld+0x1cb970a)
    #8 buf_flush_page(buf_pool_t*, buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1270:3 (mysqld+0x1cb7d70)
    #9 buf_flush_try_neighbors(page_id_t const&, buf_flush_t, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1493:9 (mysqld+0x1cc9674)
    #10 buf_flush_page_and_try_neighbors(buf_page_t*, buf_flush_t, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:1565:13 (mysqld+0x1cbadf3)
    #11 buf_do_flush_list_batch(buf_pool_t*, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1825:3 (mysqld+0x1cbbcb8)
    #12 buf_flush_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:1895:16 (mysqld+0x1cbb459)
    #13 buf_flush_do_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:2065:2 (mysqld+0x1cbcfe1)
    #14 buf_flush_lists(unsigned long, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:2167:8 (mysqld+0x1cbd5a3)
    #15 log_preflush_pool_modified_pages(unsigned long) storage/innobase/log/log0log.cc:1400:13 (mysqld+0x1eefc3b)
    #16 log_make_checkpoint_at(unsigned long, bool) storage/innobase/log/log0log.cc:1751:10 (mysqld+0x1eefb16)
    #17 buf_dblwr_create() storage/innobase/buf/buf0dblwr.cc:335:2 (mysqld+0x1cd2141)
    #18 innobase_start_or_create_for_mysql() storage/innobase/srv/srv0start.cc:2539:10 (mysqld+0x21b4d8e)
    #19 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4193:8 (mysqld+0x1a5e3d7)
    #20 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc74d33)
    #21 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x1376d5d)
    #22 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13761c0)
    #23 init_server_components() sql/mysqld.cc:5348:7 (mysqld+0xc0d0ff)
    #24 mysqld_main(int, char**) sql/mysqld.cc:5943:7 (mysqld+0xc06f9d)
    #25 main sql/main.cc:25:10 (mysqld+0xbff71b)

WARNING: ThreadSanitizer: data race (pid=29031)
  Write of size 8 at 0x0000039e48e0 by thread T15:
    #0 srv_monitor_thread storage/innobase/srv/srv0srv.cc:1699:24 (mysqld+0x21a254e)

  Previous write of size 8 at 0x0000039e48e0 by thread T14:
    #0 srv_refresh_innodb_monitor_stats() storage/innobase/srv/srv0srv.cc:1165:24 (mysqld+0x21a3124)
    #1 srv_error_monitor_thread storage/innobase/srv/srv0srv.cc:1836:3 (mysqld+0x21a2d40)

  Location is global 'srv_last_monitor_time' of size 8 at 0x0000039e48e0 (mysqld+0x0000039e48e0)
kevgs added a commit that referenced this issue Feb 20, 2018
Fixes this report:
==23122==ERROR: AddressSanitizer: use-after-poison on address 0x6190000d48d0 at pc 0x00000114c78c bp 0x7f97f40fb410 sp 0x7f97f40fabc0
WRITE of size 19 at 0x6190000d48d0 thread T27
    #0 0x114c78b in __asan_memcpy fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cc:23
    #1 0x2018dab in mysql_update(THD*, TABLE_LIST*, List<Item>&, List<Item>&, Item*, unsigned int, st_order*, unsigned long long, enum_duplicates, bool, unsigned long long*, unsigned long long*) mariadb/sql/sql_update.cc:955:15
    #2 0x1c33f1c in mysql_execute_command(THD*) mariadb/sql/sql_parse.cc:4550:21
    #3 0x1c1da1c in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) mariadb/sql/sql_parse.cc:7980:18
    #4 0x1c0f06e in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) mariadb/sql/sql_parse.cc:1824:7
    #5 0x1c17fb4 in do_command(THD*) mariadb/sql/sql_parse.cc:1369:17
    #6 0x21d1b10 in do_handle_one_connection(CONNECT*) mariadb/sql/sql_connect.cc:1402:11
    #7 0x21d1211 in handle_one_connection mariadb/sql/sql_connect.cc:1308:3
    #8 0x370ca14 in pfs_spawn_thread mariadb/storage/perfschema/pfs.cc:1862:3
    #9 0x115b6ae in __asan::AsanThread::ThreadStart(unsigned long, __sanitizer::atomic_uintptr_t*) fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_thread.cc:259
    #10 0x7f980d0aa7fb in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x77fb)
    #11 0x7f980aaceb5e in clone /build/glibc-itYbWN/glibc-2.26/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
kevgs added a commit that referenced this issue Feb 20, 2018
Fixes this report:
==3165==ERROR: AddressSanitizer: use-after-poison on address 0x61e0000270a0 at pc 0x00000114b78c bp 0x7f15d65fe120 sp 0x7f15d65fd8d0
WRITE of size 1366 at 0x61e0000270a0 thread T28
    #0 0x114b78b in __asan_memcpy fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cc:23
    #1 0x208208d in TABLE::init(THD*, TABLE_LIST*) work/mariadb/sql/table.cc:4662:3
    #2 0x19df85b in open_table(THD*, TABLE_LIST*, Open_table_context*) work/mariadb/sql/sql_base.cc:1993:10
    #3 0x19eb968 in open_and_process_table(THD*, LEX*, TABLE_LIST*, unsigned int*, unsigned int, Prelocking_strategy*, bool, Open_table_context*) work/mariadb/sql/sql_base.cc:3483:14
    #4 0x19e7c05 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) work/mariadb/sql/sql_base.cc:4001:14
    #5 0x19f4dac in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) work/mariadb/sql/sql_base.cc:4879:7
    #6 0x1627263 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) work/mariadb/sql/sql_base.h:487:10
    #7 0x1c3839c in mysql_execute_command(THD*) work/mariadb/sql/sql_parse.cc:5113:13
    #8 0x1c1b72c in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) work/mariadb/sql/sql_parse.cc:7980:18
    #9 0x1c13464 in handle_bootstrap_impl(THD*) work/mariadb/sql/sql_parse.cc:1044:5
    #10 0x1c11ff7 in do_handle_bootstrap(THD*) work/mariadb/sql/sql_parse.cc:1096:3
    #11 0x1c11d14 in handle_bootstrap work/mariadb/sql/sql_parse.cc:1079:3
    #12 0x115a6ae in __asan::AsanThread::ThreadStart(unsigned long, __sanitizer::atomic_uintptr_t*) fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_thread.cc:259
    #13 0x7f15fe1407fb in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x77fb)
    #14 0x7f15fbb64b5e in clone /build/glibc-itYbWN/glibc-2.26/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
kevgs added a commit that referenced this issue Mar 14, 2018
srv_last_monitor_time: make all accesses relaxed atomical

WARNING: ThreadSanitizer: data race (pid=12041)
  Write of size 8 at 0x000003949278 by thread T26 (mutexes: write M226445748578513120):
    #0 thd_destructor_proxy storage/innobase/handler/ha_innodb.cc:314:14 (mysqld+0x19b5505)

  Previous read of size 8 at 0x000003949278 by main thread:
    #0 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4180:11 (mysqld+0x1a03404)
    #1 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc5ec73)
    #2 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x134908d)
    #3 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13484f0)
    #4 init_server_components() sql/mysqld.cc:5345:7 (mysqld+0xbf720f)
    #5 mysqld_main(int, char**) sql/mysqld.cc:5940:7 (mysqld+0xbf107d)
    #6 main sql/main.cc:25:10 (mysqld+0xbe971b)

  Location is global 'srv_running' of size 8 at 0x000003949278 (mysqld+0x000003949278)

WARNING: ThreadSanitizer: data race (pid=27869)
  Atomic write of size 4 at 0x7b4800000c00 by thread T8:
    #0 __tsan_atomic32_exchange llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:589 (mysqld+0xbd4eac)
    #1 TTASEventMutex<GenericPolicy>::exit() storage/innobase/include/ib0mutex.h:467:7 (mysqld+0x1a8d4cb)
    #2 PolicyMutex<TTASEventMutex<GenericPolicy> >::exit() storage/innobase/include/ib0mutex.h:609:10 (mysqld+0x1a7839e)
    #3 fil_validate() storage/innobase/fil/fil0fil.cc:5535:2 (mysqld+0x1abd913)
    #4 fil_validate_skip() storage/innobase/fil/fil0fil.cc:204:9 (mysqld+0x1aba601)
    #5 fil_aio_wait(unsigned long) storage/innobase/fil/fil0fil.cc:5296:2 (mysqld+0x1abbae6)
    #6 io_handler_thread storage/innobase/srv/srv0start.cc:340:3 (mysqld+0x21abe1e)

  Previous read of size 4 at 0x7b4800000c00 by main thread (mutexes: write M1273, write M1271):
    #0 TTASEventMutex<GenericPolicy>::state() const storage/innobase/include/ib0mutex.h:530:10 (mysqld+0x21c66e2)
    #1 sync_array_detect_deadlock(sync_array_t*, sync_cell_t*, sync_cell_t*, unsigned long) storage/innobase/sync/sync0arr.cc:746:14 (mysqld+0x21c1c7a)
    #2 sync_array_wait_event(sync_array_t*, sync_cell_t*&) storage/innobase/sync/sync0arr.cc:465:6 (mysqld+0x21c1708)
    #3 TTASEventMutex<GenericPolicy>::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:516:6 (mysqld+0x1a8c206)
    #4 PolicyMutex<TTASEventMutex<GenericPolicy> >::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:635:10 (mysqld+0x1a782c3)
    #5 fil_mutex_enter_and_prepare_for_io(unsigned long) storage/innobase/fil/fil0fil.cc:1131:3 (mysqld+0x1a9a92e)
    #6 fil_io(IORequest const&, bool, page_id_t const&, page_size_t const&, unsigned long, unsigned long, void*, void*, bool) storage/innobase/fil/fil0fil.cc:5082:2 (mysqld+0x1ab8de2)
    #7 buf_flush_write_block_low(buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1112:3 (mysqld+0x1cb970a)
    #8 buf_flush_page(buf_pool_t*, buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1270:3 (mysqld+0x1cb7d70)
    #9 buf_flush_try_neighbors(page_id_t const&, buf_flush_t, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1493:9 (mysqld+0x1cc9674)
    #10 buf_flush_page_and_try_neighbors(buf_page_t*, buf_flush_t, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:1565:13 (mysqld+0x1cbadf3)
    #11 buf_do_flush_list_batch(buf_pool_t*, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1825:3 (mysqld+0x1cbbcb8)
    #12 buf_flush_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:1895:16 (mysqld+0x1cbb459)
    #13 buf_flush_do_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:2065:2 (mysqld+0x1cbcfe1)
    #14 buf_flush_lists(unsigned long, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:2167:8 (mysqld+0x1cbd5a3)
    #15 log_preflush_pool_modified_pages(unsigned long) storage/innobase/log/log0log.cc:1400:13 (mysqld+0x1eefc3b)
    #16 log_make_checkpoint_at(unsigned long, bool) storage/innobase/log/log0log.cc:1751:10 (mysqld+0x1eefb16)
    #17 buf_dblwr_create() storage/innobase/buf/buf0dblwr.cc:335:2 (mysqld+0x1cd2141)
    #18 innobase_start_or_create_for_mysql() storage/innobase/srv/srv0start.cc:2539:10 (mysqld+0x21b4d8e)
    #19 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4193:8 (mysqld+0x1a5e3d7)
    #20 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc74d33)
    #21 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x1376d5d)
    #22 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13761c0)
    #23 init_server_components() sql/mysqld.cc:5348:7 (mysqld+0xc0d0ff)
    #24 mysqld_main(int, char**) sql/mysqld.cc:5943:7 (mysqld+0xc06f9d)
    #25 main sql/main.cc:25:10 (mysqld+0xbff71b)

WARNING: ThreadSanitizer: data race (pid=29031)
  Write of size 8 at 0x0000039e48e0 by thread T15:
    #0 srv_monitor_thread storage/innobase/srv/srv0srv.cc:1699:24 (mysqld+0x21a254e)

  Previous write of size 8 at 0x0000039e48e0 by thread T14:
    #0 srv_refresh_innodb_monitor_stats() storage/innobase/srv/srv0srv.cc:1165:24 (mysqld+0x21a3124)
    #1 srv_error_monitor_thread storage/innobase/srv/srv0srv.cc:1836:3 (mysqld+0x21a2d40)

  Location is global 'srv_last_monitor_time' of size 8 at 0x0000039e48e0 (mysqld+0x0000039e48e0)
kevgs added a commit that referenced this issue Mar 19, 2018
srv_last_monitor_time: make all accesses relaxed atomical

WARNING: ThreadSanitizer: data race (pid=12041)
  Write of size 8 at 0x000003949278 by thread T26 (mutexes: write M226445748578513120):
    #0 thd_destructor_proxy storage/innobase/handler/ha_innodb.cc:314:14 (mysqld+0x19b5505)

  Previous read of size 8 at 0x000003949278 by main thread:
    #0 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4180:11 (mysqld+0x1a03404)
    #1 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc5ec73)
    #2 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x134908d)
    #3 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13484f0)
    #4 init_server_components() sql/mysqld.cc:5345:7 (mysqld+0xbf720f)
    #5 mysqld_main(int, char**) sql/mysqld.cc:5940:7 (mysqld+0xbf107d)
    #6 main sql/main.cc:25:10 (mysqld+0xbe971b)

  Location is global 'srv_running' of size 8 at 0x000003949278 (mysqld+0x000003949278)

WARNING: ThreadSanitizer: data race (pid=27869)
  Atomic write of size 4 at 0x7b4800000c00 by thread T8:
    #0 __tsan_atomic32_exchange llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:589 (mysqld+0xbd4eac)
    #1 TTASEventMutex<GenericPolicy>::exit() storage/innobase/include/ib0mutex.h:467:7 (mysqld+0x1a8d4cb)
    #2 PolicyMutex<TTASEventMutex<GenericPolicy> >::exit() storage/innobase/include/ib0mutex.h:609:10 (mysqld+0x1a7839e)
    #3 fil_validate() storage/innobase/fil/fil0fil.cc:5535:2 (mysqld+0x1abd913)
    #4 fil_validate_skip() storage/innobase/fil/fil0fil.cc:204:9 (mysqld+0x1aba601)
    #5 fil_aio_wait(unsigned long) storage/innobase/fil/fil0fil.cc:5296:2 (mysqld+0x1abbae6)
    #6 io_handler_thread storage/innobase/srv/srv0start.cc:340:3 (mysqld+0x21abe1e)

  Previous read of size 4 at 0x7b4800000c00 by main thread (mutexes: write M1273, write M1271):
    #0 TTASEventMutex<GenericPolicy>::state() const storage/innobase/include/ib0mutex.h:530:10 (mysqld+0x21c66e2)
    #1 sync_array_detect_deadlock(sync_array_t*, sync_cell_t*, sync_cell_t*, unsigned long) storage/innobase/sync/sync0arr.cc:746:14 (mysqld+0x21c1c7a)
    #2 sync_array_wait_event(sync_array_t*, sync_cell_t*&) storage/innobase/sync/sync0arr.cc:465:6 (mysqld+0x21c1708)
    #3 TTASEventMutex<GenericPolicy>::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:516:6 (mysqld+0x1a8c206)
    #4 PolicyMutex<TTASEventMutex<GenericPolicy> >::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:635:10 (mysqld+0x1a782c3)
    #5 fil_mutex_enter_and_prepare_for_io(unsigned long) storage/innobase/fil/fil0fil.cc:1131:3 (mysqld+0x1a9a92e)
    #6 fil_io(IORequest const&, bool, page_id_t const&, page_size_t const&, unsigned long, unsigned long, void*, void*, bool) storage/innobase/fil/fil0fil.cc:5082:2 (mysqld+0x1ab8de2)
    #7 buf_flush_write_block_low(buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1112:3 (mysqld+0x1cb970a)
    #8 buf_flush_page(buf_pool_t*, buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1270:3 (mysqld+0x1cb7d70)
    #9 buf_flush_try_neighbors(page_id_t const&, buf_flush_t, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1493:9 (mysqld+0x1cc9674)
    #10 buf_flush_page_and_try_neighbors(buf_page_t*, buf_flush_t, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:1565:13 (mysqld+0x1cbadf3)
    #11 buf_do_flush_list_batch(buf_pool_t*, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1825:3 (mysqld+0x1cbbcb8)
    #12 buf_flush_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:1895:16 (mysqld+0x1cbb459)
    #13 buf_flush_do_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:2065:2 (mysqld+0x1cbcfe1)
    #14 buf_flush_lists(unsigned long, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:2167:8 (mysqld+0x1cbd5a3)
    #15 log_preflush_pool_modified_pages(unsigned long) storage/innobase/log/log0log.cc:1400:13 (mysqld+0x1eefc3b)
    #16 log_make_checkpoint_at(unsigned long, bool) storage/innobase/log/log0log.cc:1751:10 (mysqld+0x1eefb16)
    #17 buf_dblwr_create() storage/innobase/buf/buf0dblwr.cc:335:2 (mysqld+0x1cd2141)
    #18 innobase_start_or_create_for_mysql() storage/innobase/srv/srv0start.cc:2539:10 (mysqld+0x21b4d8e)
    #19 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4193:8 (mysqld+0x1a5e3d7)
    #20 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc74d33)
    #21 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x1376d5d)
    #22 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13761c0)
    #23 init_server_components() sql/mysqld.cc:5348:7 (mysqld+0xc0d0ff)
    #24 mysqld_main(int, char**) sql/mysqld.cc:5943:7 (mysqld+0xc06f9d)
    #25 main sql/main.cc:25:10 (mysqld+0xbff71b)

WARNING: ThreadSanitizer: data race (pid=29031)
  Write of size 8 at 0x0000039e48e0 by thread T15:
    #0 srv_monitor_thread storage/innobase/srv/srv0srv.cc:1699:24 (mysqld+0x21a254e)

  Previous write of size 8 at 0x0000039e48e0 by thread T14:
    #0 srv_refresh_innodb_monitor_stats() storage/innobase/srv/srv0srv.cc:1165:24 (mysqld+0x21a3124)
    #1 srv_error_monitor_thread storage/innobase/srv/srv0srv.cc:1836:3 (mysqld+0x21a2d40)

  Location is global 'srv_last_monitor_time' of size 8 at 0x0000039e48e0 (mysqld+0x0000039e48e0)
midenok pushed a commit that referenced this issue Mar 28, 2018
srv_last_monitor_time: make all accesses relaxed atomical

WARNING: ThreadSanitizer: data race (pid=12041)
  Write of size 8 at 0x000003949278 by thread T26 (mutexes: write M226445748578513120):
    #0 thd_destructor_proxy storage/innobase/handler/ha_innodb.cc:314:14 (mysqld+0x19b5505)

  Previous read of size 8 at 0x000003949278 by main thread:
    #0 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4180:11 (mysqld+0x1a03404)
    #1 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc5ec73)
    #2 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x134908d)
    #3 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13484f0)
    #4 init_server_components() sql/mysqld.cc:5345:7 (mysqld+0xbf720f)
    #5 mysqld_main(int, char**) sql/mysqld.cc:5940:7 (mysqld+0xbf107d)
    #6 main sql/main.cc:25:10 (mysqld+0xbe971b)

  Location is global 'srv_running' of size 8 at 0x000003949278 (mysqld+0x000003949278)

WARNING: ThreadSanitizer: data race (pid=27869)
  Atomic write of size 4 at 0x7b4800000c00 by thread T8:
    #0 __tsan_atomic32_exchange llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:589 (mysqld+0xbd4eac)
    #1 TTASEventMutex<GenericPolicy>::exit() storage/innobase/include/ib0mutex.h:467:7 (mysqld+0x1a8d4cb)
    #2 PolicyMutex<TTASEventMutex<GenericPolicy> >::exit() storage/innobase/include/ib0mutex.h:609:10 (mysqld+0x1a7839e)
    #3 fil_validate() storage/innobase/fil/fil0fil.cc:5535:2 (mysqld+0x1abd913)
    #4 fil_validate_skip() storage/innobase/fil/fil0fil.cc:204:9 (mysqld+0x1aba601)
    #5 fil_aio_wait(unsigned long) storage/innobase/fil/fil0fil.cc:5296:2 (mysqld+0x1abbae6)
    #6 io_handler_thread storage/innobase/srv/srv0start.cc:340:3 (mysqld+0x21abe1e)

  Previous read of size 4 at 0x7b4800000c00 by main thread (mutexes: write M1273, write M1271):
    #0 TTASEventMutex<GenericPolicy>::state() const storage/innobase/include/ib0mutex.h:530:10 (mysqld+0x21c66e2)
    #1 sync_array_detect_deadlock(sync_array_t*, sync_cell_t*, sync_cell_t*, unsigned long) storage/innobase/sync/sync0arr.cc:746:14 (mysqld+0x21c1c7a)
    #2 sync_array_wait_event(sync_array_t*, sync_cell_t*&) storage/innobase/sync/sync0arr.cc:465:6 (mysqld+0x21c1708)
    #3 TTASEventMutex<GenericPolicy>::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:516:6 (mysqld+0x1a8c206)
    #4 PolicyMutex<TTASEventMutex<GenericPolicy> >::enter(unsigned int, unsigned int, char const*, unsigned int) storage/innobase/include/ib0mutex.h:635:10 (mysqld+0x1a782c3)
    #5 fil_mutex_enter_and_prepare_for_io(unsigned long) storage/innobase/fil/fil0fil.cc:1131:3 (mysqld+0x1a9a92e)
    #6 fil_io(IORequest const&, bool, page_id_t const&, page_size_t const&, unsigned long, unsigned long, void*, void*, bool) storage/innobase/fil/fil0fil.cc:5082:2 (mysqld+0x1ab8de2)
    #7 buf_flush_write_block_low(buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1112:3 (mysqld+0x1cb970a)
    #8 buf_flush_page(buf_pool_t*, buf_page_t*, buf_flush_t, bool) storage/innobase/buf/buf0flu.cc:1270:3 (mysqld+0x1cb7d70)
    #9 buf_flush_try_neighbors(page_id_t const&, buf_flush_t, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1493:9 (mysqld+0x1cc9674)
    #10 buf_flush_page_and_try_neighbors(buf_page_t*, buf_flush_t, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:1565:13 (mysqld+0x1cbadf3)
    #11 buf_do_flush_list_batch(buf_pool_t*, unsigned long, unsigned long) storage/innobase/buf/buf0flu.cc:1825:3 (mysqld+0x1cbbcb8)
    #12 buf_flush_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:1895:16 (mysqld+0x1cbb459)
    #13 buf_flush_do_batch(buf_pool_t*, buf_flush_t, unsigned long, unsigned long, flush_counters_t*) storage/innobase/buf/buf0flu.cc:2065:2 (mysqld+0x1cbcfe1)
    #14 buf_flush_lists(unsigned long, unsigned long, unsigned long*) storage/innobase/buf/buf0flu.cc:2167:8 (mysqld+0x1cbd5a3)
    #15 log_preflush_pool_modified_pages(unsigned long) storage/innobase/log/log0log.cc:1400:13 (mysqld+0x1eefc3b)
    #16 log_make_checkpoint_at(unsigned long, bool) storage/innobase/log/log0log.cc:1751:10 (mysqld+0x1eefb16)
    #17 buf_dblwr_create() storage/innobase/buf/buf0dblwr.cc:335:2 (mysqld+0x1cd2141)
    #18 innobase_start_or_create_for_mysql() storage/innobase/srv/srv0start.cc:2539:10 (mysqld+0x21b4d8e)
    #19 innobase_init(void*) storage/innobase/handler/ha_innodb.cc:4193:8 (mysqld+0x1a5e3d7)
    #20 ha_initialize_handlerton(st_plugin_int*) sql/handler.cc:522:31 (mysqld+0xc74d33)
    #21 plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool) sql/sql_plugin.cc:1447:9 (mysqld+0x1376d5d)
    #22 plugin_init(int*, char**, int) sql/sql_plugin.cc:1729:15 (mysqld+0x13761c0)
    #23 init_server_components() sql/mysqld.cc:5348:7 (mysqld+0xc0d0ff)
    #24 mysqld_main(int, char**) sql/mysqld.cc:5943:7 (mysqld+0xc06f9d)
    #25 main sql/main.cc:25:10 (mysqld+0xbff71b)

WARNING: ThreadSanitizer: data race (pid=29031)
  Write of size 8 at 0x0000039e48e0 by thread T15:
    #0 srv_monitor_thread storage/innobase/srv/srv0srv.cc:1699:24 (mysqld+0x21a254e)

  Previous write of size 8 at 0x0000039e48e0 by thread T14:
    #0 srv_refresh_innodb_monitor_stats() storage/innobase/srv/srv0srv.cc:1165:24 (mysqld+0x21a3124)
    #1 srv_error_monitor_thread storage/innobase/srv/srv0srv.cc:1836:3 (mysqld+0x21a2d40)

  Location is global 'srv_last_monitor_time' of size 8 at 0x0000039e48e0 (mysqld+0x0000039e48e0)
kevgs added a commit that referenced this issue Jul 2, 2018
Close connection handler on connection failure. This fixes 14 failing tests in
main suite under clang+ASAN build.

ASAN repost looks like this:
=================================================================
==25495==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 146280 byte(s) in 115 object(s) allocated from:
    #0 0x4fba47 in calloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:138
    #1 0x5a7a02 in mysql_init /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:977:26
    #2 0x570a7a in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6096:26
    #3 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #4 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

Indirect leak of 7065600 byte(s) in 115 object(s) allocated from:
    #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129
    #1 0x637a83 in my_context_init /work/mariadb/libmariadb/libmariadb/ma_context.c:367:23
    #2 0x59fd16 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2738:9
    #3 0x5bc1d4 in mysql_options /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3242:10
    #4 0x570b94 in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6103:7
    #5 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #6 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

Indirect leak of 940240 byte(s) in 115 object(s) allocated from:
    #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129
    #1 0x64386e in ma_init_dynamic_array /work/mariadb/libmariadb/libmariadb/ma_array.c:49:31
    #2 0x649ead in _hash_init /work/mariadb/libmariadb/libmariadb/ma_hash.c:52:7
    #3 0x5a3080 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2938:13
    #4 0x5bc20c in mysql_options4 /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3248:10
    #5 0x56f63b in connect_n_handle_errors(st_command*, st_mysql*, char const*, char const*, char const*, char const*, int, char const*) /work/mariadb/client/mysqltest.cc:5874:3
    #6 0x57146b in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6193:7
    #7 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #8 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
kevgs added a commit that referenced this issue Jul 2, 2018
Close connection handler on connection failure. This fixes 14 failing tests in
main suite under clang+ASAN build.

ASAN report for main.connect looks like this:
=================================================================
==25495==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 146280 byte(s) in 115 object(s) allocated from:
    #0 0x4fba47 in calloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:138
    #1 0x5a7a02 in mysql_init /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:977:26
    #2 0x570a7a in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6096:26
    #3 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #4 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

Indirect leak of 7065600 byte(s) in 115 object(s) allocated from:
    #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129
    #1 0x637a83 in my_context_init /work/mariadb/libmariadb/libmariadb/ma_context.c:367:23
    #2 0x59fd16 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2738:9
    #3 0x5bc1d4 in mysql_options /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3242:10
    #4 0x570b94 in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6103:7
    #5 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #6 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

Indirect leak of 940240 byte(s) in 115 object(s) allocated from:
    #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129
    #1 0x64386e in ma_init_dynamic_array /work/mariadb/libmariadb/libmariadb/ma_array.c:49:31
    #2 0x649ead in _hash_init /work/mariadb/libmariadb/libmariadb/ma_hash.c:52:7
    #3 0x5a3080 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2938:13
    #4 0x5bc20c in mysql_options4 /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3248:10
    #5 0x56f63b in connect_n_handle_errors(st_command*, st_mysql*, char const*, char const*, char const*, char const*, int, char const*) /work/mariadb/client/mysqltest.cc:5874:3
    #6 0x57146b in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6193:7
    #7 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #8 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
...
sysprg pushed a commit that referenced this issue Jul 3, 2018
           specific temporary errors

The optimistic parallel slave's worker thread could face a run-time error due to
the algorithm's specifics which allows for conflicts like the reported
"Can't find record in 'table'".
A typical stack is like

{noformat}
#0  handler::print_error (this=0x61c00008f8a0, error=149, errflag=0) at handler.cc:3650
#1  0x0000555555e95361 in write_record (thd=thd@entry=0x62a0000a2208, table=table@entry=0x61f00008ce88, info=info@entry=0x7fffdee356d0) at sql_insert.cc:1944
#2  0x0000555555ea7767 in mysql_insert (thd=thd@entry=0x62a0000a2208, table_list=0x61b00012ada0, fields=..., values_list=..., update_fields=..., update_values=..., duplic=<optimized out>, ignore=<optimized out>) at sql_insert.cc:1039
#3  0x0000555555efda90 in mysql_execute_command (thd=thd@entry=0x62a0000a2208) at sql_parse.cc:3927
#4  0x0000555555f0cc50 in mysql_parse (thd=0x62a0000a2208, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at sql_parse.cc:7449
#5  0x00005555566d4444 in Query_log_event::do_apply_event (this=0x61200005b9c8, rgi=<optimized out>, query_arg=<optimized out>, q_len_arg=<optimized out>) at log_event.cc:4508
#6  0x00005555566d639e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>) at log_event.cc:4185
#7  0x0000555555d738cf in Log_event::apply_event (rgi=0x61d0001ea080, this=0x61200005b9c8) at log_event.h:1343
#8  apply_event_and_update_pos_apply (ev=ev@entry=0x61200005b9c8, thd=thd@entry=0x62a0000a2208, rgi=rgi@entry=0x61d0001ea080, reason=<optimized out>) at slave.cc:3479
#9  0x0000555555d8596b in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x61200005b9c8, thd=thd@entry=0x62a0000a2208, rgi=rgi@entry=0x61d0001ea080) at slave.cc:3623
#10 0x00005555562aca83 in rpt_handle_event (qev=qev@entry=0x6190000fa088, rpt=rpt@entry=0x62200002bd68) at rpl_parallel.cc:50
#11 0x00005555562bd04e in handle_rpl_parallel_thread (arg=arg@entry=0x62200002bd68) at rpl_parallel.cc:1258
{noformat}

Here {{handler::print_error}} computes whether to error log the
current error when --log-warnings > 1. The decision flag is consulted
bu {{my_message_sql()}} which can be eventually called.
In the bug case the decision is to log.
However in the optimistic mode slave applier case any conflict is
attempted to resolve with rollback and retry to success. Hence the
logging is at least extraneous.

The case is fixed with adding a new flag {{ME_LOG_AS_WARN}} which
{{handler::print_error}} may propagate further on through {{my_error}}
when the error comes from an optimistically running slave worker thread.

The new flag effectively requests the warning level for the errlog record,
while the thread's DA records the actual error (which is regarded as temporary one
by the parallel slave error handler).
sysprg pushed a commit that referenced this issue Feb 1, 2019
Close connection handler on connection failure. This fixes 14 failing tests in
main suite under clang+ASAN build.

ASAN report for main.connect looks like this:
=================================================================
==25495==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 146280 byte(s) in 115 object(s) allocated from:
    #0 0x4fba47 in calloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:138
    #1 0x5a7a02 in mysql_init /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:977:26
    #2 0x570a7a in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6096:26
    #3 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #4 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

Indirect leak of 7065600 byte(s) in 115 object(s) allocated from:
    #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129
    #1 0x637a83 in my_context_init /work/mariadb/libmariadb/libmariadb/ma_context.c:367:23
    #2 0x59fd16 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2738:9
    #3 0x5bc1d4 in mysql_options /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3242:10
    #4 0x570b94 in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6103:7
    #5 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #6 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

Indirect leak of 940240 byte(s) in 115 object(s) allocated from:
    #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129
    #1 0x64386e in ma_init_dynamic_array /work/mariadb/libmariadb/libmariadb/ma_array.c:49:31
    #2 0x649ead in _hash_init /work/mariadb/libmariadb/libmariadb/ma_hash.c:52:7
    #3 0x5a3080 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2938:13
    #4 0x5bc20c in mysql_options4 /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3248:10
    #5 0x56f63b in connect_n_handle_errors(st_command*, st_mysql*, char const*, char const*, char const*, char const*, int, char const*) /work/mariadb/client/mysqltest.cc:5874:3
    #6 0x57146b in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6193:7
    #7 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9
    #8 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
...

Closes MariaDB#809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant