Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12575

Server crash in AGGR_OP::put_record or in JOIN_CACHE::free or Invalid write in JOIN::make_aggr_tables_info

    XMLWordPrintable

    Details

      Description

      The problem was introduced in 10.2 by this commit:

      commit f675eab7dc7f1eb4f4b61bfdd548d9e8052678a4
      Author: Vicențiu Ciorbaru <vicentiu@mariadb.org>
      Date:   Tue Feb 7 14:02:25 2017 +0200
       
          MDEV-10122: MariaDB does not support group functions in some contexts where MySQL does
      

      CREATE TABLE t1 (pk INT PRIMARY KEY);
      INSERT INTO t1 VALUES (1),(2);
       
      ( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )
      UNION
      ( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )
      ;
      

      10.2 d66c171e0fd4 valgrind build with --valgrind

      ==19047== Thread 6:
      ==19047== Invalid write of size 8
      ==19047==    at 0x4C2F547: memset (vg_replace_strmem.c:1234)
      ==19047==    by 0x6F99A2: JOIN::make_aggr_tables_info() (sql_select.cc:2494)
      ==19047==    by 0x6F857B: JOIN::optimize_inner() (sql_select.cc:2154)
      ==19047==    by 0x6F49AF: JOIN::optimize() (sql_select.cc:1085)
      ==19047==    by 0x79A96B: st_select_lex_unit::optimize() (sql_union.cc:903)
      ==19047==    by 0x79ABA2: st_select_lex_unit::exec() (sql_union.cc:937)
      ==19047==    by 0x797AE1: mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long) (sql_union.cc:41)
      ==19047==    by 0x6F220D: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:351)
      ==19047==    by 0x6BDB0C: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:6431)
      ==19047==    by 0x6B3B49: mysql_execute_command(THD*) (sql_parse.cc:3448)
      ==19047==    by 0x6C14DF: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:7874)
      ==19047==    by 0x6AF5B5: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1812)
      ==19047==    by 0x6ADF25: do_command(THD*) (sql_parse.cc:1362)
      ==19047==    by 0x7FDDDC: do_handle_one_connection(CONNECT*) (sql_connect.cc:1354)
      ==19047==    by 0x7FDB69: handle_one_connection (sql_connect.cc:1260)
      ==19047==    by 0xC3824B: pfs_spawn_thread (pfs.cc:1862)
      ==19047==  Address 0xd9cc3f0 is 0 bytes after a block of size 1,920 alloc'd
      ==19047==    at 0x4C28BAF: malloc (vg_replace_malloc.c:299)
      ==19047==    by 0x10C95EF: my_malloc (my_malloc.c:101)
      ==19047==    by 0x10BA758: alloc_root (my_alloc.c:184)
      ==19047==    by 0x5ECD98: Query_arena::alloc(unsigned long) (sql_class.h:965)
      ==19047==    by 0x70B159: JOIN::get_best_combination() (sql_select.cc:8770)
      ==19047==    by 0x7008DD: make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*) (sql_select.cc:4441)
      ==19047==    by 0x6F61CA: JOIN::optimize_inner() (sql_select.cc:1505)
      ==19047==    by 0x6F49AF: JOIN::optimize() (sql_select.cc:1085)
      ==19047==    by 0x79A96B: st_select_lex_unit::optimize() (sql_union.cc:903)
      ==19047==    by 0x79ABA2: st_select_lex_unit::exec() (sql_union.cc:937)
      ==19047==    by 0x797AE1: mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long) (sql_union.cc:41)
      ==19047==    by 0x6F220D: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:351)
      ==19047==    by 0x6BDB0C: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:6431)
      ==19047==    by 0x6B3B49: mysql_execute_command(THD*) (sql_parse.cc:3448)
      ==19047==    by 0x6C14DF: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:7874)
      ==19047==    by 0x6AF5B5: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1812)
      

      10.2 d66c171e0fd4, debug build without valgrind

      #3  <signal handler called>
      #4  0x00007f568292f19a in AGGR_OP::put_record (this=0x7f5668018320, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:26274
      #5  0x00007f5682933b55 in AGGR_OP::put_record (this=0x7f5668018320) at /data/src/10.2/sql/sql_select.h:971
      #6  0x00007f568291a68c in sub_select_postjoin_aggr (join=0x7f5668014e08, join_tab=0x7f5668017d70, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18179
      #7  0x00007f568291b28f in evaluate_join_record (join=0x7f5668014e08, join_tab=0x7f56680179c0, error=0) at /data/src/10.2/sql/sql_select.cc:18678
      #8  0x00007f568291ab9f in sub_select (join=0x7f5668014e08, join_tab=0x7f56680179c0, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18458
      #9  0x00007f568291a137 in do_select (join=0x7f5668014e08, procedure=0x0) at /data/src/10.2/sql/sql_select.cc:18002
      #10 0x00007f56828f4d61 in JOIN::exec_inner (this=0x7f5668014e08) at /data/src/10.2/sql/sql_select.cc:3464
      #11 0x00007f56828f4266 in JOIN::exec (this=0x7f5668014e08) at /data/src/10.2/sql/sql_select.cc:3267
      #12 0x00007f5682990f6c in st_select_lex_unit::exec (this=0x7f56680045e0) at /data/src/10.2/sql/sql_union.cc:989
      #13 0x00007f568298db18 in mysql_union (thd=0x7f5668000b00, lex=0x7f5668004518, result=0x7f56680143e0, unit=0x7f56680045e0, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:41
      #14 0x00007f56828e9de8 in handle_select (thd=0x7f5668000b00, lex=0x7f5668004518, result=0x7f56680143e0, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #15 0x00007f56828b6223 in execute_sqlcom_select (thd=0x7f5668000b00, all_tables=0x7f5668012598) at /data/src/10.2/sql/sql_parse.cc:6431
      #16 0x00007f56828ac262 in mysql_execute_command (thd=0x7f5668000b00) at /data/src/10.2/sql/sql_parse.cc:3448
      #17 0x00007f56828b9bf6 in mysql_parse (thd=0x7f5668000b00, rawbuf=0x7f5668012348 "( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )\nUNION\n( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )", length=127, parser_state=0x7f567a6c6210, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7874
      #18 0x00007f56828a7cce in dispatch_command (command=COM_QUERY, thd=0x7f5668000b00, packet=0x7f56680087a1 "( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )\nUNION\n( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )\n", packet_length=128, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1812
      #19 0x00007f56828a663e in do_command (thd=0x7f5668000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #20 0x00007f56829f0e15 in do_handle_one_connection (connect=0x7f568550a260) at /data/src/10.2/sql/sql_connect.cc:1354
      #21 0x00007f56829f0ba2 in handle_one_connection (arg=0x7f568550a260) at /data/src/10.2/sql/sql_connect.cc:1260
      #22 0x00007f5682e09ec8 in pfs_spawn_thread (arg=0x7f56854e4b10) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #23 0x00007f5681ecc064 in start_thread (arg=0x7f567a6c7700) at pthread_create.c:309
      #24 0x00007f56802bc62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      On a somewhat more complicated variation of a query/data I'm also getting this:

      #3  <signal handler called>
      #4  0x00007fa65d625912 in JOIN_CACHE::free (this=0x8f8f8f8f8f8f8f8f) at /data/src/10.2/sql/sql_join_cache.h:673
      #5  0x00007fa65d5fc22e in st_join_table::cleanup (this=0x7fa644145e88) at /data/src/10.2/sql/sql_select.cc:11594
      #6  0x00007fa65d5fd27b in JOIN::cleanup (this=0x7fa6441429d0, full=true) at /data/src/10.2/sql/sql_select.cc:12013
      #7  0x00007fa65d5e6e7d in JOIN::destroy (this=0x7fa6441429d0) at /data/src/10.2/sql/sql_select.cc:3490
      #8  0x00007fa65d684660 in st_select_lex::cleanup (this=0x7fa644004d10) at /data/src/10.2/sql/sql_union.cc:1460
      #9  0x00007fa65d684078 in st_select_lex_unit::cleanup (this=0x7fa6440045e0) at /data/src/10.2/sql/sql_union.cc:1293
      #10 0x00007fa65d67fb27 in mysql_union (thd=0x7fa644000b00, lex=0x7fa644004518, result=0x7fa6441428a8, unit=0x7fa6440045e0, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:42
      #11 0x00007fa65d5dbde8 in handle_select (thd=0x7fa644000b00, lex=0x7fa644004518, result=0x7fa6441428a8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #12 0x00007fa65d5a8223 in execute_sqlcom_select (thd=0x7fa644000b00, all_tables=0x7fa644013d28) at /data/src/10.2/sql/sql_parse.cc:6431
      #13 0x00007fa65d59e262 in mysql_execute_command (thd=0x7fa644000b00) at /data/src/10.2/sql/sql_parse.cc:3448
      #14 0x00007fa65d5abbf6 in mysql_parse (thd=0x7fa644000b00, rawbuf=0x7fa644012348 "(  SELECT DISTINCT CASE ( - '2002-02-28 20:56:24.017038' ) WHEN '2000-04-25' THEN ( DECODE( 29442, '2008-08-08 01:40:28.034421' ) ) END AS field1, BIT_COUNT( 'kqalfzzichaixrgiozbqsqeqqaagdemuthoxygdao"..., length=1005, parser_state=0x7fa6553b8210, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7874
      #15 0x00007fa65d599cce in dispatch_command (command=COM_QUERY, thd=0x7fa644000b00, packet=0x7fa6440087a1 "", packet_length=1006, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1812
      #16 0x00007fa65d59863e in do_command (thd=0x7fa644000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #17 0x00007fa65d6e2e15 in do_handle_one_connection (connect=0x7fa660bc9260) at /data/src/10.2/sql/sql_connect.cc:1354
      #18 0x00007fa65d6e2ba2 in handle_one_connection (arg=0x7fa660bc9260) at /data/src/10.2/sql/sql_connect.cc:1260
      #19 0x00007fa65dafbec8 in pfs_spawn_thread (arg=0x7fa660ba3b10) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #20 0x00007fa65cbbe064 in start_thread (arg=0x7fa6553b9700) at pthread_create.c:309
      #21 0x00007fa65afae62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      Yet another variation of a stack trace (adding to make it searchable in JIRA):

      mysqld.exe!SQL_SELECT::cleanup()[opt_range.cc:1212]
      mysqld.exe!SQL_SELECT::~SQL_SELECT()[opt_range.cc:1226]
      mysqld.exe!SQL_SELECT::`scalar deleting destructor'()
      mysqld.exe!st_join_table::cleanup()[sql_select.cc:11615]
      mysqld.exe!JOIN::cleanup()[sql_select.cc:12041]
      mysqld.exe!JOIN::destroy()[sql_select.cc:3501]
      mysqld.exe!st_select_lex::cleanup()[sql_union.cc:1461]
      mysqld.exe!st_select_lex_unit::cleanup()[sql_union.cc:1294]
      mysqld.exe!mysql_union()[sql_union.cc:42]
      mysqld.exe!handle_select()[sql_select.cc:351]
      mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6442]
      mysqld.exe!mysql_execute_command()[sql_parse.cc:3457]
      mysqld.exe!mysql_parse()[sql_parse.cc:7879]
      mysqld.exe!dispatch_command()[sql_parse.cc:1819]
      mysqld.exe!do_command()[sql_parse.cc:1361]
      mysqld.exe!threadpool_process_request()[threadpool_common.cc:346]
      mysqld.exe!tp_callback()[threadpool_common.cc:192]
      mysqld.exe!tp_callback()[threadpool_win.cc:378]
      mysqld.exe!work_callback()[threadpool_win.cc:452]
      ntdll.dll!RtlFreeUnicodeString()
      ntdll.dll!RtlFreeUnicodeString()
      KERNEL32.DLL!BaseThreadInitThunk()
      ntdll.dll!RtlUserThreadStart()
      

      Even more stack traces (unsimplified test cases attached for double-checking after the fix), all stack traces are from 10.2 rev 5ff2db7f67401511b30dbd3fc69a1ea87d7e8cc4, all tests are to be run with --lower-case-table-names=1.

      t1.test

      #3  <signal handler called>
      #4  0x00007f20be90422e in create_tmp_table (thd=0x7f20a4000b00, param=0x7f20a40182a8, fields=..., group=0x0, distinct=true, save_sum_fields=true, select_options=550024249345, rows_limit=18446744073709551615, table_alias=0x7f20bf30c524 "", do_not_open=true, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:16565
      #5  0x00007f20be8e11f9 in JOIN::create_postjoin_aggr_table (this=0x7f20a4015b08, tab=0x7f20a416e978, table_fields=0x7f20a4015e40, table_group=0x0, save_sum_fields=true, distinct=true, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:2835
      #6  0x00007f20be8dfc22 in JOIN::make_aggr_tables_info (this=0x7f20a4015b08) at /data/src/10.2/sql/sql_select.cc:2517
      #7  0x00007f20be8de705 in JOIN::optimize_inner (this=0x7f20a4015b08) at /data/src/10.2/sql/sql_select.cc:2159
      #8  0x00007f20be8dabb9 in JOIN::optimize (this=0x7f20a4015b08) at /data/src/10.2/sql/sql_select.cc:1085
      #9  0x00007f20be97f962 in st_select_lex_unit::optimize (this=0x7f20a40045e8) at /data/src/10.2/sql/sql_union.cc:906
      #10 0x00007f20be97fb99 in st_select_lex_unit::exec (this=0x7f20a40045e8) at /data/src/10.2/sql/sql_union.cc:940
      #11 0x00007f20be97caba in mysql_union (thd=0x7f20a4000b00, lex=0x7f20a4004520, result=0x7f20a40159e0, unit=0x7f20a40045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:41
      #12 0x00007f20be8d8430 in handle_select (thd=0x7f20a4000b00, lex=0x7f20a4004520, result=0x7f20a40159e0, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #13 0x00007f20be8a43c8 in execute_sqlcom_select (thd=0x7f20a4000b00, all_tables=0x7f20a40128d0) at /data/src/10.2/sql/sql_parse.cc:6443
      #14 0x00007f20be89a407 in mysql_execute_command (thd=0x7f20a4000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #15 0x00007f20be8a7d88 in mysql_parse (thd=0x7f20a4000b00, rawbuf=0x7f20a4012378 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `DD` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` )"..., length=472, parser_state=0x7f20b6491200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #16 0x00007f20be895e34 in dispatch_command (command=COM_QUERY, thd=0x7f20a4000b00, packet=0x7f20a41631c1 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `DD` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` )"..., packet_length=472, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #17 0x00007f20be894775 in do_command (thd=0x7f20a4000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #18 0x00007f20be9e04e7 in do_handle_one_connection (connect=0x7f20c11769f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #19 0x00007f20be9e0274 in handle_one_connection (arg=0x7f20c11769f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #20 0x00007f20bed27870 in pfs_spawn_thread (arg=0x7f20c12110a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #21 0x00007f20bdeb7064 in start_thread (arg=0x7f20b6492700) at pthread_create.c:309
      #22 0x00007f20bc09c62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      t3.test

      #3  <signal handler called>
      #4  0x00007f298bda1686 in TABLE_LIST::is_with_table_recursive_reference (this=0x8f8f8f8f8f8f8f8f) at /data/src/10.2/sql/sql_cte.cc:1068
      #5  0x00007f298bc36bb9 in st_join_table::cleanup (this=0x7f29681689e8) at /data/src/10.2/sql/sql_select.cc:11672
      #6  0x00007f298bc37d5f in JOIN::cleanup (this=0x7f2968015bf0, full=true) at /data/src/10.2/sql/sql_select.cc:12105
      #7  0x00007f298bc21643 in JOIN::destroy (this=0x7f2968015bf0) at /data/src/10.2/sql/sql_select.cc:3503
      #8  0x00007f298bcbf63c in st_select_lex::cleanup (this=0x7f2968004d20) at /data/src/10.2/sql/sql_union.cc:1463
      #9  0x00007f298bcbf054 in st_select_lex_unit::cleanup (this=0x7f29680045e8) at /data/src/10.2/sql/sql_union.cc:1296
      #10 0x00007f298bcbaac9 in mysql_union (thd=0x7f2968000b00, lex=0x7f2968004520, result=0x7f2968015ac8, unit=0x7f29680045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:42
      #11 0x00007f298bc16430 in handle_select (thd=0x7f2968000b00, lex=0x7f2968004520, result=0x7f2968015ac8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #12 0x00007f298bbe23c8 in execute_sqlcom_select (thd=0x7f2968000b00, all_tables=0x7f29680129b8) at /data/src/10.2/sql/sql_parse.cc:6443
      #13 0x00007f298bbd8407 in mysql_execute_command (thd=0x7f2968000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #14 0x00007f298bbe5d88 in mysql_parse (thd=0x7f2968000b00, rawbuf=0x7f2968012378 "/* GenTest::Transform::ExecuteAsUnion */ (  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ),"..., length=587, parser_state=0x7f297f7b3200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #15 0x00007f298bbd3e34 in dispatch_command (command=COM_QUERY, thd=0x7f2968000b00, packet=0x7f29681631c1 "/* GenTest::Transform::ExecuteAsUnion */ (  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ),"..., packet_length=587, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #16 0x00007f298bbd2775 in do_command (thd=0x7f2968000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #17 0x00007f298bd1e4e7 in do_handle_one_connection (connect=0x7f298eae19f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #18 0x00007f298bd1e274 in handle_one_connection (arg=0x7f298eae19f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #19 0x00007f298c065870 in pfs_spawn_thread (arg=0x7f298eb7c0a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #20 0x00007f298b1f5064 in start_thread (arg=0x7f297f7b4700) at pthread_create.c:309
      #21 0x00007f29893da62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      t4.test

      #3  <signal handler called>
      #4  0x00007faeba8526a5 in sf_malloc_usable_size (ptr=0xa5a5a5a5a5a5a5a5, is_thread_specific=0x7faeb1a67de7 "") at /data/src/10.2/mysys/safemalloc.c:215
      #5  0x00007faeba83fddf in my_free (ptr=0xa5a5a5a5a5a5a5a5) at /data/src/10.2/mysys/my_malloc.c:215
      #6  0x00007faeb9efa4d5 in JOIN_CACHE::free (this=0x7faea0168d20) at /data/src/10.2/sql/sql_join_cache.h:673
      #7  0x00007faeb9ed0cfe in st_join_table::cleanup (this=0x7faea01689e8) at /data/src/10.2/sql/sql_select.cc:11686
      #8  0x00007faeb9ed1d5f in JOIN::cleanup (this=0x7faea0015bf0, full=true) at /data/src/10.2/sql/sql_select.cc:12105
      #9  0x00007faeb9ebb643 in JOIN::destroy (this=0x7faea0015bf0) at /data/src/10.2/sql/sql_select.cc:3503
      #10 0x00007faeb9f5963c in st_select_lex::cleanup (this=0x7faea0004d20) at /data/src/10.2/sql/sql_union.cc:1463
      #11 0x00007faeb9f59054 in st_select_lex_unit::cleanup (this=0x7faea00045e8) at /data/src/10.2/sql/sql_union.cc:1296
      #12 0x00007faeb9f54ac9 in mysql_union (thd=0x7faea0000b00, lex=0x7faea0004520, result=0x7faea0015ac8, unit=0x7faea00045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:42
      #13 0x00007faeb9eb0430 in handle_select (thd=0x7faea0000b00, lex=0x7faea0004520, result=0x7faea0015ac8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #14 0x00007faeb9e7c3c8 in execute_sqlcom_select (thd=0x7faea0000b00, all_tables=0x7faea00129b8) at /data/src/10.2/sql/sql_parse.cc:6443
      #15 0x00007faeb9e72407 in mysql_execute_command (thd=0x7faea0000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #16 0x00007faeb9e7fd88 in mysql_parse (thd=0x7faea0000b00, rawbuf=0x7faea0012378 "/* GenTest::Transform::ExecuteAsUnion */ (  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ),"..., length=587, parser_state=0x7faeb1a69200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #17 0x00007faeb9e6de34 in dispatch_command (command=COM_QUERY, thd=0x7faea0000b00, packet=0x7faea01631c1 "/* GenTest::Transform::ExecuteAsUnion */ (  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ),"..., packet_length=587, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #18 0x00007faeb9e6c775 in do_command (thd=0x7faea0000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #19 0x00007faeb9fb84e7 in do_handle_one_connection (connect=0x7faebdc889f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #20 0x00007faeb9fb8274 in handle_one_connection (arg=0x7faebdc889f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #21 0x00007faeba2ff870 in pfs_spawn_thread (arg=0x7faebdd230a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #22 0x00007faeb948f064 in start_thread (arg=0x7faeb1a6a700) at pthread_create.c:309
      #23 0x00007faeb767462d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      t5.test

      mysqld: /data/src/10.2/sql/sql_select.cc:17902: void set_postjoin_aggr_write_func(JOIN_TAB*): Assertion `table && aggr' failed.
      170710 19:17:27 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f18ed8d9312 in __GI___assert_fail (assertion=0x7f18f0c05244 "table && aggr", file=0x7f18f0c03b08 "/data/src/10.2/sql/sql_select.cc", line=17902, function=0x7f18f0c077a0 <set_postjoin_aggr_write_func(st_join_table*)::__PRETTY_FUNCTION__> "void set_postjoin_aggr_write_func(JOIN_TAB*)") at assert.c:101
      #8  0x00007f18f01ff3e2 in set_postjoin_aggr_write_func (tab=0x7f18cc1689e8) at /data/src/10.2/sql/sql_select.cc:17902
      #9  0x00007f18f01d6f72 in JOIN::make_aggr_tables_info (this=0x7f18cc015a38) at /data/src/10.2/sql/sql_select.cc:2562
      #10 0x00007f18f01d5705 in JOIN::optimize_inner (this=0x7f18cc015a38) at /data/src/10.2/sql/sql_select.cc:2159
      #11 0x00007f18f01d1bb9 in JOIN::optimize (this=0x7f18cc015a38) at /data/src/10.2/sql/sql_select.cc:1085
      #12 0x00007f18f0276962 in st_select_lex_unit::optimize (this=0x7f18cc0045e8) at /data/src/10.2/sql/sql_union.cc:906
      #13 0x00007f18f0276b99 in st_select_lex_unit::exec (this=0x7f18cc0045e8) at /data/src/10.2/sql/sql_union.cc:940
      #14 0x00007f18f0273aba in mysql_union (thd=0x7f18cc000b00, lex=0x7f18cc004520, result=0x7f18cc015910, unit=0x7f18cc0045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:41
      #15 0x00007f18f01cf430 in handle_select (thd=0x7f18cc000b00, lex=0x7f18cc004520, result=0x7f18cc015910, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #16 0x00007f18f019b3c8 in execute_sqlcom_select (thd=0x7f18cc000b00, all_tables=0x7f18cc012898) at /data/src/10.2/sql/sql_parse.cc:6443
      #17 0x00007f18f0191407 in mysql_execute_command (thd=0x7f18cc000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #18 0x00007f18f019ed88 in mysql_parse (thd=0x7f18cc000b00, rawbuf=0x7f18cc012378 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` )"..., length=446, parser_state=0x7f18e8589200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #19 0x00007f18f018ce34 in dispatch_command (command=COM_QUERY, thd=0x7f18cc000b00, packet=0x7f18cc1631c1 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` )"..., packet_length=446, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #20 0x00007f18f018b775 in do_command (thd=0x7f18cc000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #21 0x00007f18f02d74e7 in do_handle_one_connection (connect=0x7f18f2e549f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #22 0x00007f18f02d7274 in handle_one_connection (arg=0x7f18f2e549f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #23 0x00007f18f061e870 in pfs_spawn_thread (arg=0x7f18f2eef0a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #24 0x00007f18ef7ae064 in start_thread (arg=0x7f18e858a700) at pthread_create.c:309
      #25 0x00007f18ed99362d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      t6.test (similar to one of the older ones)

      #3  <signal handler called>
      #4  0x00007fb68233c4c6 in JOIN_CACHE::free (this=0xa5a5a5a5a5a5a5a5) at /data/src/10.2/sql/sql_join_cache.h:673
      #5  0x00007fb682312cfe in st_join_table::cleanup (this=0x7fb6681689e8) at /data/src/10.2/sql/sql_select.cc:11686
      #6  0x00007fb682313d5f in JOIN::cleanup (this=0x7fb668015ae0, full=true) at /data/src/10.2/sql/sql_select.cc:12105
      #7  0x00007fb6822fd643 in JOIN::destroy (this=0x7fb668015ae0) at /data/src/10.2/sql/sql_select.cc:3503
      #8  0x00007fb68239b63c in st_select_lex::cleanup (this=0x7fb668004d20) at /data/src/10.2/sql/sql_union.cc:1463
      #9  0x00007fb68239b054 in st_select_lex_unit::cleanup (this=0x7fb6680045e8) at /data/src/10.2/sql/sql_union.cc:1296
      #10 0x00007fb682396ac9 in mysql_union (thd=0x7fb668000b00, lex=0x7fb668004520, result=0x7fb6680159b8, unit=0x7fb6680045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:42
      #11 0x00007fb6822f2430 in handle_select (thd=0x7fb668000b00, lex=0x7fb668004520, result=0x7fb6680159b8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #12 0x00007fb6822be3c8 in execute_sqlcom_select (thd=0x7fb668000b00, all_tables=0x7fb6680128a8) at /data/src/10.2/sql/sql_parse.cc:6443
      #13 0x00007fb6822b4407 in mysql_execute_command (thd=0x7fb668000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #14 0x00007fb6822c1d88 in mysql_parse (thd=0x7fb668000b00, rawbuf=0x7fb668012378 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` )"..., length=455, parser_state=0x7fb679eab200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #15 0x00007fb6822afe34 in dispatch_command (command=COM_QUERY, thd=0x7fb668000b00, packet=0x7fb6681631c1 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` )"..., packet_length=455, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #16 0x00007fb6822ae775 in do_command (thd=0x7fb668000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #17 0x00007fb6823fa4e7 in do_handle_one_connection (connect=0x7fb68568d9f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #18 0x00007fb6823fa274 in handle_one_connection (arg=0x7fb68568d9f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #19 0x00007fb682741870 in pfs_spawn_thread (arg=0x7fb6857280a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #20 0x00007fb6818d1064 in start_thread (arg=0x7fb679eac700) at pthread_create.c:309
      #21 0x00007fb67fab662d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      t7.test

      #3  <signal handler called>
      #4  0x00007f52db74ae88 in next_breadth_first_tab (first_top_tab=0x7f52b8017a78, n_top_tabs_count=1, tab=0x7f52b80181d8) at /data/src/10.2/sql/sql_select.cc:8540
      #5  0x00007f52db753db5 in JOIN::cleanup (this=0x7f52b8015798, full=true) at /data/src/10.2/sql/sql_select.cc:12101
      #6  0x00007f52db73d643 in JOIN::destroy (this=0x7f52b8015798) at /data/src/10.2/sql/sql_select.cc:3503
      #7  0x00007f52db7db63c in st_select_lex::cleanup (this=0x7f52b8004d20) at /data/src/10.2/sql/sql_union.cc:1463
      #8  0x00007f52db7db054 in st_select_lex_unit::cleanup (this=0x7f52b80045e8) at /data/src/10.2/sql/sql_union.cc:1296
      #9  0x00007f52db7d6ac9 in mysql_union (thd=0x7f52b8000b00, lex=0x7f52b8004520, result=0x7f52b8015670, unit=0x7f52b80045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:42
      #10 0x00007f52db732430 in handle_select (thd=0x7f52b8000b00, lex=0x7f52b8004520, result=0x7f52b8015670, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #11 0x00007f52db6fe3c8 in execute_sqlcom_select (thd=0x7f52b8000b00, all_tables=0x7f52b8012898) at /data/src/10.2/sql/sql_parse.cc:6443
      #12 0x00007f52db6f4407 in mysql_execute_command (thd=0x7f52b8000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #13 0x00007f52db701d88 in mysql_parse (thd=0x7f52b8000b00, rawbuf=0x7f52b8012378 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` )"..., length=447, parser_state=0x7f52d4291200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #14 0x00007f52db6efe34 in dispatch_command (command=COM_QUERY, thd=0x7f52b8000b00, packet=0x7f52b81631c1 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` )"..., packet_length=447, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #15 0x00007f52db6ee775 in do_command (thd=0x7f52b8000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #16 0x00007f52db83a4e7 in do_handle_one_connection (connect=0x7f52dee439f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #17 0x00007f52db83a274 in handle_one_connection (arg=0x7f52dee439f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #18 0x00007f52dbb81870 in pfs_spawn_thread (arg=0x7f52deede0a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #19 0x00007f52dad11064 in start_thread (arg=0x7f52d4292700) at pthread_create.c:309
      #20 0x00007f52d8ef662d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      t8.test

      #3  <signal handler called>
      #4  0x00007f79ebcd1224 in JOIN::create_postjoin_aggr_table (this=0x7f79c8015ab8, tab=0x7f79c816e978, table_fields=0x7f79c8015df0, table_group=0x0, save_sum_fields=true, distinct=true, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:2839
      #5  0x00007f79ebccfc22 in JOIN::make_aggr_tables_info (this=0x7f79c8015ab8) at /data/src/10.2/sql/sql_select.cc:2517
      #6  0x00007f79ebcce705 in JOIN::optimize_inner (this=0x7f79c8015ab8) at /data/src/10.2/sql/sql_select.cc:2159
      #7  0x00007f79ebccabb9 in JOIN::optimize (this=0x7f79c8015ab8) at /data/src/10.2/sql/sql_select.cc:1085
      #8  0x00007f79ebd6f962 in st_select_lex_unit::optimize (this=0x7f79c80045e8) at /data/src/10.2/sql/sql_union.cc:906
      #9  0x00007f79ebd6fb99 in st_select_lex_unit::exec (this=0x7f79c80045e8) at /data/src/10.2/sql/sql_union.cc:940
      #10 0x00007f79ebd6caba in mysql_union (thd=0x7f79c8000b00, lex=0x7f79c8004520, result=0x7f79c8015990, unit=0x7f79c80045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:41
      #11 0x00007f79ebcc8430 in handle_select (thd=0x7f79c8000b00, lex=0x7f79c8004520, result=0x7f79c8015990, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #12 0x00007f79ebc943c8 in execute_sqlcom_select (thd=0x7f79c8000b00, all_tables=0x7f79c8012880) at /data/src/10.2/sql/sql_parse.cc:6443
      #13 0x00007f79ebc8a407 in mysql_execute_command (thd=0x7f79c8000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #14 0x00007f79ebc97d88 in mysql_parse (thd=0x7f79c8000b00, rawbuf=0x7f79c8012378 "(  SELECT DISTINCT 1 AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` ) )  /* QNO "..., length=461, parser_state=0x7f79e4082200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #15 0x00007f79ebc85e34 in dispatch_command (command=COM_QUERY, thd=0x7f79c8000b00, packet=0x7f79c81631c1 "(  SELECT DISTINCT 1 AS field1 FROM `dd` WHERE `col_datetime_key` HAVING BINARY -4642648265865560064 ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` ) )  /* QNO "..., packet_length=461, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #16 0x00007f79ebc84775 in do_command (thd=0x7f79c8000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #17 0x00007f79ebdd04e7 in do_handle_one_connection (connect=0x7f79ee72a9f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #18 0x00007f79ebdd0274 in handle_one_connection (arg=0x7f79ee72a9f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #19 0x00007f79ec117870 in pfs_spawn_thread (arg=0x7f79ee7c50a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #20 0x00007f79eb2a7064 in start_thread (arg=0x7f79e4083700) at pthread_create.c:309
      #21 0x00007f79e948c62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      t9.test (similar to one of old ones)

      #3  <signal handler called>
      #4  0x00007f8204084d3e in AGGR_OP::put_record (this=0x7f81e0018350, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:26371
      #5  0x00007f8204089709 in AGGR_OP::put_record (this=0x7f81e0018350) at /data/src/10.2/sql/sql_select.h:973
      #6  0x00007f82040701cd in sub_select_postjoin_aggr (join=0x7f81e0015918, join_tab=0x7f81e0017f80, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18269
      #7  0x00007f8204070dd0 in evaluate_join_record (join=0x7f81e0015918, join_tab=0x7f81e0017bd0, error=0) at /data/src/10.2/sql/sql_select.cc:18768
      #8  0x00007f82040706e0 in sub_select (join=0x7f81e0015918, join_tab=0x7f81e0017bd0, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18548
      #9  0x00007f820406fc79 in do_select (join=0x7f81e0015918, procedure=0x0) at /data/src/10.2/sql/sql_select.cc:18092
      #10 0x00007f820404a527 in JOIN::exec_inner (this=0x7f81e0015918) at /data/src/10.2/sql/sql_select.cc:3477
      #11 0x00007f82040499f6 in JOIN::exec (this=0x7f81e0015918) at /data/src/10.2/sql/sql_select.cc:3278
      #12 0x00007f82040e6f48 in st_select_lex_unit::exec (this=0x7f81e00045e8) at /data/src/10.2/sql/sql_union.cc:992
      #13 0x00007f82040e3aba in mysql_union (thd=0x7f81e0000b00, lex=0x7f81e0004520, result=0x7f81e00157f0, unit=0x7f81e00045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:41
      #14 0x00007f820403f430 in handle_select (thd=0x7f81e0000b00, lex=0x7f81e0004520, result=0x7f81e00157f0, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #15 0x00007f820400b3c8 in execute_sqlcom_select (thd=0x7f81e0000b00, all_tables=0x7f81e0012888) at /data/src/10.2/sql/sql_parse.cc:6443
      #16 0x00007f8204001407 in mysql_execute_command (thd=0x7f81e0000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #17 0x00007f820400ed88 in mysql_parse (thd=0x7f81e0000b00, rawbuf=0x7f81e0012378 "(  SELECT DISTINCT FOUND_ROWS() AS field1 FROM `DD` WHERE `col_datetime_key` ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` ) )  /* QNO 6261 CON_ID 16 */  ) UNI"..., length=437, parser_state=0x7f81fc3f9200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #18 0x00007f8203ffce34 in dispatch_command (command=COM_QUERY, thd=0x7f81e0000b00, packet=0x7f81e01631c1 "", packet_length=437, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #19 0x00007f8203ffb775 in do_command (thd=0x7f81e0000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #20 0x00007f82041474e7 in do_handle_one_connection (connect=0x7f82079f49f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #21 0x00007f8204147274 in handle_one_connection (arg=0x7f82079f49f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #22 0x00007f820448e870 in pfs_spawn_thread (arg=0x7f8207a8f0a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #23 0x00007f820361e064 in start_thread (arg=0x7f81fc3fa700) at pthread_create.c:309
      #24 0x00007f820180362d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      t10.test

      #3  <signal handler called>
      #4  0x00007fa83ec84499 in base_list_iterator::next_fast (this=0x7fa83694bbc0) at /data/src/10.2/sql/sql_list.h:464
      #5  0x00007fa83ec918d5 in List_iterator_fast<Item>::operator++ (this=0x7fa83694bbc0) at /data/src/10.2/sql/sql_list.h:585
      #6  0x00007fa83edd07fa in copy_fields (param=0x7fa8240182e0) at /data/src/10.2/sql/sql_select.cc:23081
      #7  0x00007fa83edc8d2f in end_write (join=0x7fa8240158a8, join_tab=0x7fa824017f10, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:19942
      #8  0x00007fa83edd9d8c in AGGR_OP::put_record (this=0x7fa82416e728, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:26375
      #9  0x00007fa83edde709 in AGGR_OP::put_record (this=0x7fa82416e728) at /data/src/10.2/sql/sql_select.h:973
      #10 0x00007fa83edc51cd in sub_select_postjoin_aggr (join=0x7fa8240158a8, join_tab=0x7fa824017f10, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18269
      #11 0x00007fa83edc5dd0 in evaluate_join_record (join=0x7fa8240158a8, join_tab=0x7fa824017b60, error=0) at /data/src/10.2/sql/sql_select.cc:18768
      #12 0x00007fa83edc56e0 in sub_select (join=0x7fa8240158a8, join_tab=0x7fa824017b60, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18548
      #13 0x00007fa83edc4c79 in do_select (join=0x7fa8240158a8, procedure=0x0) at /data/src/10.2/sql/sql_select.cc:18092
      #14 0x00007fa83ed9f527 in JOIN::exec_inner (this=0x7fa8240158a8) at /data/src/10.2/sql/sql_select.cc:3477
      #15 0x00007fa83ed9e9f6 in JOIN::exec (this=0x7fa8240158a8) at /data/src/10.2/sql/sql_select.cc:3278
      #16 0x00007fa83ee3bf48 in st_select_lex_unit::exec (this=0x7fa8240045e8) at /data/src/10.2/sql/sql_union.cc:992
      #17 0x00007fa83ee38aba in mysql_union (thd=0x7fa824000b00, lex=0x7fa824004520, result=0x7fa824015780, unit=0x7fa8240045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:41
      #18 0x00007fa83ed94430 in handle_select (thd=0x7fa824000b00, lex=0x7fa824004520, result=0x7fa824015780, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #19 0x00007fa83ed603c8 in execute_sqlcom_select (thd=0x7fa824000b00, all_tables=0x7fa824012818) at /data/src/10.2/sql/sql_parse.cc:6443
      #20 0x00007fa83ed56407 in mysql_execute_command (thd=0x7fa824000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #21 0x00007fa83ed63d88 in mysql_parse (thd=0x7fa824000b00, rawbuf=0x7fa824012378 "(  SELECT DISTINCT 1 FROM `DD` WHERE `col_datetime_key` ORDER BY DES_ENCRYPT( 0, `col_varchar_nokey` ), BENCHMARK( 5, VAR_SAMP( `col_date_key` ) )  /* QNO 6261 CON_ID 16 */  ) UNION ALL (  SELECT FOUN"..., length=416, parser_state=0x7fa83694d200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #22 0x00007fa83ed51e34 in dispatch_command (command=COM_QUERY, thd=0x7fa824000b00, packet=0x7fa8241631c1 "", packet_length=416, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #23 0x00007fa83ed50775 in do_command (thd=0x7fa824000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #24 0x00007fa83ee9c4e7 in do_handle_one_connection (connect=0x7fa84204f9f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #25 0x00007fa83ee9c274 in handle_one_connection (arg=0x7fa84204f9f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #26 0x00007fa83f1e3870 in pfs_spawn_thread (arg=0x7fa8420ea0a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #27 0x00007fa83e373064 in start_thread (arg=0x7fa83694e700) at pthread_create.c:309
      #28 0x00007fa83c55862d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

        Attachments

        1. t1.test
          2 kB
        2. t10.test
          2 kB
        3. t3.test
          14 kB
        4. t4.test
          14 kB
        5. t5.test
          14 kB
        6. t6.test
          14 kB
        7. t7.test
          2 kB
        8. t8.test
          2 kB
        9. t9.test
          2 kB

          Issue Links

            Activity

              People

              Assignee:
              varun Varun Gupta (Inactive)
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: