Show
added a comment - - edited RQG grammar mdev8339.yy
query_init:
CREATE TABLE IF NOT EXISTS t1 (`pk` INT AUTO_INCREMENT PRIMARY KEY, `c` VARCHAR(32), KEY(`c`)) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS t2 LIKE t1; CREATE TABLE IF NOT EXISTS t3 LIKE t1; CREATE TABLE IF NOT EXISTS t4 LIKE t1;
query:
SELECT * FROM { 't'.(int(rand(500))+1) } ORDER BY `pk` LIMIT 1 |
INSERT INTO { 't'.(int(rand(500))+1) } (`c`) VALUES ( _english ), ( _english ), ( _english ), ( _english ), ( _english ) |
DELETE FROM { 't'.(int(rand(500))+1) } WHERE `c` = _english ORDER BY `pk` LIMIT _digit ;
RQG command line
perl ./runall-new.pl --mysqld=--table-open-cache=3 --threads=2 --duration=300 --queries=100M --skip-gendata --grammar=mdev8339.yy --basedir=<basedir> --vardir=<vardir>
Note: the degenerate value table_open_cache=3 is not critical, it just makes the test faster (less tables to create). However, the problem is reproducible as well with e.g. the default value table_open_cache=400 and with 500 tables.
Stack trace from 10.1.5 release bintar
#2 <signal handler called>
#3 0x00000000007288c1 in I_P_List_iterator (a=..., this=<optimized out>) at /home/buildbot/buildbot/build/sql/sql_plist.h:181
#4 free_tables_back (this=<optimized out>) at /home/buildbot/buildbot/build/sql/table_cache.h:110
#5 tc_add_table_callback (element=0x7f45e7d2cea8, arg=0x7f45e6b20700) at /home/buildbot/buildbot/build/sql/table_cache.cc:237
#6 0x0000000000be883b in lfind (head=0x7f45e7c12078, cs=0x0, hashnr=0, key=0x7f45e6b20700 "test", keylen=<optimized out>, cursor=0x7f45e6b20570, pins=0x7f4610d08180, callback=0x728850 <tc_add_table_callback(TDC_element*, tc_add_table_arg*)>) at /home/buildbot/buildbot/build/mysys/lf_hash.c:125
#7 0x0000000000be8afe in lf_hash_iterate (hash=0x1475200, pins=0x7f4610d08180, action=0x728850 <tc_add_table_callback(TDC_element*, tc_add_table_arg*)>, argument=0x7f45e6b20700) at /home/buildbot/buildbot/build/mysys/lf_hash.c:517
#8 0x0000000000727870 in tdc_iterate (thd=0x7f45f4b86008, action=0x728850 <tc_add_table_callback(TDC_element*, tc_add_table_arg*)>, argument=0x7f45e6b20700, no_dups=false) at /home/buildbot/buildbot/build/sql/table_cache.cc:1082
#9 0x0000000000728658 in tc_add_table (thd=0x7f45f4b86008, table=0x7f45e7068c08) at /home/buildbot/buildbot/build/sql/table_cache.cc:265
#10 0x0000000000586e65 in open_table (thd=0x7f45f4b86008, table_list=0x7f45e7c20140, ot_ctx=0x7f45e6b21090) at /home/buildbot/buildbot/build/sql/sql_base.cc:2572
#11 0x00000000005883b1 in open_and_process_table (ot_ctx=<optimized out>, has_prelocking_list=<optimized out>, prelocking_strategy=<optimized out>, flags=<optimized out>, counter=<optimized out>, tables=<optimized out>, lex=0x7f45f4b897c8, thd=<optimized out>) at /home/buildbot/buildbot/build/sql/sql_base.cc:4016
#12 open_tables (thd=0x7f45f4b86008, options=..., start=0x7f45e6b21148, counter=0x7f45e6b2116c, flags=0, prelocking_strategy=0x7f45e6b21920) at /home/buildbot/buildbot/build/sql/sql_base.cc:4526
#13 0x00000000005888eb in open_and_lock_tables (thd=0x3, options=..., tables=0x7f45e7c20140, derived=true, flags=3889352776, prelocking_strategy=0x42e1) at /home/buildbot/buildbot/build/sql/sql_base.cc:5184
#14 0x00000000005a79cf in open_and_lock_tables (flags=<optimized out>, derived=<optimized out>, tables=<optimized out>, thd=<optimized out>) at /home/buildbot/buildbot/build/sql/sql_base.h:530
#15 mysql_delete (thd=0x7f45f4b86008, table_list=0x7f45e7c20140, conds=0x7f45e7c208d8, order_list=0x7f45f4b8a1b8, limit=1, options=0, result=0x0) at /home/buildbot/buildbot/build/sql/sql_delete.cc:249
#16 0x00000000005d2955 in mysql_execute_command (thd=0x7f45f4b86008) at /home/buildbot/buildbot/build/sql/sql_parse.cc:4041
#17 0x00000000005d6fe6 in mysql_parse (thd=0x7f45f4b86008, rawbuf=0x7f45e7c20020 "DELETE FROM t2 WHERE `c` = 'could' ORDER BY `pk` LIMIT 1", length=<optimized out>, parser_state=0x7f45e6b23010) at /home/buildbot/buildbot/build/sql/sql_parse.cc:7173
#18 0x00000000005da10d in dispatch_command (command=COM_QUERY, thd=0x7f45f4b86008, packet=0x7f45f4b8c009 "DELETE FROM t2 WHERE `c` = 'could' ORDER BY `pk` LIMIT 1", packet_length=56) at /home/buildbot/buildbot/build/sql/sql_parse.cc:1470
#19 0x00000000005da517 in do_command (thd=0x7f45f4b86008) at /home/buildbot/buildbot/build/sql/sql_parse.cc:1093
#20 0x00000000006b3d90 in do_handle_one_connection (thd_arg=<optimized out>) at /home/buildbot/buildbot/build/sql/sql_connect.cc:1347
#21 0x00000000006b3fb2 in handle_one_connection (arg=0x7f45f4b86008) at /home/buildbot/buildbot/build/sql/sql_connect.cc:1258
#22 0x00007f4612ceeb50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#23 0x00007f4611a2995d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#24 0x0000000000000000 in ?? ()
Stack trace from debug build of 10.1 commit 93fc04ff1dc613a9ad75ccc57988a6b57b94b6cb
#3 <signal handler called>
#4 0x00007f25c7069af9 in TDC_element::free_tables_back (this=0x7f25a145f710) at 10.1/sql/table_cache.h:110
#5 0x00007f25c706759f in tc_add_table_callback (element=0x7f25a145f710, arg=0x7f25c686f9a0) at 10.1/sql/table_cache.cc:237
#6 0x00007f25c76f9d2d in lfind (head=0x7f25a737a270, cs=0x0, hashnr=0, key=0x7f25c686f9a0 "test", keylen=0, cursor=0x7f25c686f820, pins=0x7f25c3d5f180, callback=0x7f25c7067565 <tc_add_table_callback(TDC_element*, tc_add_table_arg*)>) at 10.1/mysys/lf_hash.c:125
#7 0x00007f25c76fa9a4 in lf_hash_iterate (hash=0x7f25c81a0040, pins=0x7f25c3d5f180, action=0x7f25c7067565 <tc_add_table_callback(TDC_element*, tc_add_table_arg*)>, argument=0x7f25c686f9a0) at 10.1/mysys/lf_hash.c:517
#8 0x00007f25c7069649 in tdc_iterate (thd=0x7f25a130c070, action=0x7f25c7067565 <tc_add_table_callback(TDC_element*, tc_add_table_arg*)>, argument=0x7f25c686f9a0, no_dups=false) at 10.1/sql/table_cache.cc:1082
#9 0x00007f25c706778c in tc_add_table (thd=0x7f25a130c070, table=0x7f25a14e8e70) at 10.1/sql/table_cache.cc:265
#10 0x00007f25c6e3491d in open_table (thd=0x7f25a130c070, table_list=0x7f25a142c290, ot_ctx=0x7f25c686ffd0) at 10.1/sql/sql_base.cc:2572
#11 0x00007f25c6e37070 in open_and_process_table (thd=0x7f25a130c070, lex=0x7f25a130f968, tables=0x7f25a142c290, counter=0x7f25c6870074, flags=0, prelocking_strategy=0x7f25c68700e0, has_prelocking_list=false, ot_ctx=0x7f25c686ffd0) at 10.1/sql/sql_base.cc:4016
#12 0x00007f25c6e38165 in open_tables (thd=0x7f25a130c070, options=..., start=0x7f25c6870058, counter=0x7f25c6870074, flags=0, prelocking_strategy=0x7f25c68700e0) at 10.1/sql/sql_base.cc:4526
#13 0x00007f25c6e3933e in open_and_lock_tables (thd=0x7f25a130c070, options=..., tables=0x7f25a142c290, derived=true, flags=0, prelocking_strategy=0x7f25c68700e0) at 10.1/sql/sql_base.cc:5184
#14 0x00007f25c6e2ce3b in open_and_lock_tables (thd=0x7f25a130c070, tables=0x7f25a142c290, derived=true, flags=0) at 10.1/sql/sql_base.h:530
#15 0x00007f25c6ea836a in execute_sqlcom_select (thd=0x7f25a130c070, all_tables=0x7f25a142c290) at 10.1/sql/sql_parse.cc:5718
#16 0x00007f25c6e9eb24 in mysql_execute_command (thd=0x7f25a130c070) at 10.1/sql/sql_parse.cc:2938
#17 0x00007f25c6eabdff in mysql_parse (thd=0x7f25a130c070, rawbuf=0x7f25a142c088 "SELECT * FROM t4 ORDER BY `pk` LIMIT 1", length=38, parser_state=0x7f25c68711f0) at 10.1/sql/sql_parse.cc:7173
#18 0x00007f25c6e9ad78 in dispatch_command (command=COM_QUERY, thd=0x7f25a130c070, packet=0x7f25a13ed071 "SELECT * FROM t4 ORDER BY `pk` LIMIT 1", packet_length=38) at 10.1/sql/sql_parse.cc:1470
#19 0x00007f25c6e99a98 in do_command (thd=0x7f25a130c070) at 10.1/sql/sql_parse.cc:1093
#20 0x00007f25c6fdb40c in do_handle_one_connection (thd_arg=0x7f25a130c070) at 10.1/sql/sql_connect.cc:1347
#21 0x00007f25c6fdb151 in handle_one_connection (arg=0x7f25a130c070) at 10.1/sql/sql_connect.cc:1258
#22 0x00007f25c654fb50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#23 0x00007f25c45e495d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
Elena Stepanova, could you try to reproduce this?