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

Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed in handler::ha_rnd_next on EXPLAIN INSERT .. SELECT

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.14, 10.1.1
    • Fix Version/s: 10.0.15, 10.1.2
    • Component/s: Optimizer
    • Labels:
      None

      Description

      Test case

      CREATE TABLE t1 (a INT);
      CREATE TABLE t2 (a INT);
      INSERT INTO t2 VALUES (1),(2);
      CREATE VIEW v1 (a) AS SELECT a FROM t1;
      CREATE VIEW v2 AS SELECT * FROM v1;
       
      EXPLAIN INSERT INTO v2 SELECT * FROM t2;

      10.0/sql/handler.cc:2551: int handler::ha_rnd_next(uchar*): Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed.
      141106 19:18:04 [ERROR] mysqld got signal 6 ;

      #6  0x00007f75e63936f1 in *__GI___assert_fail (assertion=0xfed398 "table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2", file=<optimized out>, line=2551, function=0xfefd80 "int handler::ha_rnd_next(uchar*)") at assert.c:81
      #7  0x000000000086d439 in handler::ha_rnd_next (this=0x7f75de47f088, buf=0x7f75de428488 "\377") at 10.0/sql/handler.cc:2550
      #8  0x000000000086e451 in handler::read_first_row (this=0x7f75de47f088, buf=0x7f75de428488 "\377", primary_key=64) at 10.0/sql/handler.cc:2749
      #9  0x00000000006efcd5 in handler::ha_read_first_row (this=0x7f75de47f088, buf=0x7f75de428488 "\377", primary_key=64) at 10.0/sql/sql_class.h:4912
      #10 0x00000000006db8a0 in join_read_system (tab=0x7f75de5f3cf8) at 10.0/sql/sql_select.cc:18215
      #11 0x00000000006db47f in join_read_const_table (tab=0x7f75de5f3cf8, pos=0x7f75de5f4230) at 10.0/sql/sql_select.cc:18111
      #12 0x00000000006b8de7 in make_join_statistics (join=0x7f75de5f37c0, tables_list=..., conds=0x0, keyuse_array=0x7f75de5f3ac8) at 10.0/sql/sql_select.cc:3626
      #13 0x00000000006b124f in JOIN::optimize_inner (this=0x7f75de5f37c0) at 10.0/sql/sql_select.cc:1339
      #14 0x00000000006b01e6 in JOIN::optimize (this=0x7f75de5f37c0) at 10.0/sql/sql_select.cc:1024
      #15 0x00000000006b7d6b in mysql_select (thd=0x7f75e0f2f070, rref_pointer_array=0x7f75de45cab0, tables=0x7f75de679470, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748612, result=0x7f75de679f80, unit=0x7f75de45c150, select_lex=0x7f75de45c838) at 10.0/sql/sql_select.cc:3294
      #16 0x00000000006ea0a5 in mysql_explain_union (thd=0x7f75e0f2f070, unit=0x7f75de45c150, result=0x7f75de679f80) at 10.0/sql/sql_select.cc:23898
      #17 0x00000000006e9e04 in select_describe (join=0x7f75de5f10a8, need_tmp_table=false, need_order=false, distinct=false, message=0x0) at 10.0/sql/sql_select.cc:23855
      #18 0x00000000006b5748 in JOIN::exec_inner (this=0x7f75de5f10a8) at 10.0/sql/sql_select.cc:2568
      #19 0x00000000006b4a90 in JOIN::exec (this=0x7f75de5f10a8) at 10.0/sql/sql_select.cc:2370
      #20 0x00000000006b7dfb in mysql_select (thd=0x7f75e0f2f070, rref_pointer_array=0x7f75de678ab0, tables=0x7f75de415150, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748612, result=0x7f75de679f80, unit=0x7f75de678150, select_lex=0x7f75de678838) at 10.0/sql/sql_select.cc:3308
      #21 0x00000000006ea0a5 in mysql_explain_union (thd=0x7f75e0f2f070, unit=0x7f75de678150, result=0x7f75de679f80) at 10.0/sql/sql_select.cc:23898
      #22 0x00000000006e9e04 in select_describe (join=0x7f75de45d470, need_tmp_table=false, need_order=false, distinct=false, message=0x0) at 10.0/sql/sql_select.cc:23855
      #23 0x00000000006b5748 in JOIN::exec_inner (this=0x7f75de45d470) at 10.0/sql/sql_select.cc:2568
      #24 0x00000000006b4a90 in JOIN::exec (this=0x7f75de45d470) at 10.0/sql/sql_select.cc:2370
      #25 0x00000000006b7dfb in mysql_select (thd=0x7f75e0f2f070, rref_pointer_array=0x7f75e0f336e0, tables=0x7f75de4148a8, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925892, result=0x7f75de679f80, unit=0x7f75e0f32d80, select_lex=0x7f75e0f33468) at 10.0/sql/sql_select.cc:3308
      #26 0x00000000006ae3f5 in handle_select (thd=0x7f75e0f2f070, lex=0x7f75e0f32cb8, result=0x7f75de679f80, setup_tables_done_option=1073741824) at 10.0/sql/sql_select.cc:373
      #27 0x000000000067dae9 in mysql_execute_command (thd=0x7f75e0f2f070) at 10.0/sql/sql_parse.cc:3519
      #28 0x000000000068586f in mysql_parse (thd=0x7f75e0f2f070, rawbuf=0x7f75de414088 "EXPLAIN INSERT INTO v2 SELECT * FROM t2", length=39, parser_state=0x7f75e8360630) at 10.0/sql/sql_parse.cc:6407
      #29 0x0000000000678652 in dispatch_command (command=COM_QUERY, thd=0x7f75e0f2f070, packet=0x7f75e1ff6071 "EXPLAIN INSERT INTO v2 SELECT * FROM t2", packet_length=39) at 10.0/sql/sql_parse.cc:1299
      #30 0x00000000006779f7 in do_command (thd=0x7f75e0f2f070) at 10.0/sql/sql_parse.cc:996
      #31 0x00000000007944aa in do_handle_one_connection (thd_arg=0x7f75e0f2f070) at 10.0/sql/sql_connect.cc:1379
      #32 0x00000000007941fd in handle_one_connection (arg=0x7f75e0f2f070) at 10.0/sql/sql_connect.cc:1293
      #33 0x0000000000ccb4a6 in pfs_spawn_thread (arg=0x7f75e0367bf0) at 10.0/storage/perfschema/pfs.cc:1860
      #34 0x00007f75e7f4cb50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #35 0x00007f75e644420d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      Stack trace from

      revision-id: sergii@pisem.net-20141103164737-457hfby1eg82zol9
      date: 2014-11-03 17:47:37 +0100
      build-date: 2014-11-06 19:22:17 +0400
      revno: 4471
      branch-nick: 10.0

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: