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

Assertion `fixed' failed in Item_direct_view_ref::used_tables on 2nd execution of PS with view

    Details

      Description

      +underlined text+

      CREATE TABLE t1 (a VARCHAR(8));
      INSERT INTO t1 VALUES ('foo'),('bar');
      CREATE VIEW v1 AS SELECT * FROM t1;
      PREPARE stmt FROM "SELECT NULLIF( a, CONVERT( 'qux' USING utf8 ) ) FROM v1";
      EXECUTE stmt;
      EXECUTE stmt;
       
      # Cleanup
      DEALLOCATE PREPARE stmt;
      DROP VIEW v1;
      DROP TABLE t1;
      

      10.1 a04e4f531a7d0

      mysqld: /data/src/10.1/sql/item.cc:9872: virtual table_map Item_direct_view_ref::used_tables() const: Assertion `fixed' failed.
      180223 23:22:03 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007ff62ee57ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000556733030413 in Item_direct_view_ref::used_tables (this=0x7ff6261af918) at /data/src/10.1/sql/item.cc:9872
      #9  0x0000556732d12521 in Used_tables_and_const_cache::used_tables_and_const_cache_join (this=0x7ff6261aca50, item=0x7ff6261af918) at /data/src/10.1/sql/item.h:3648
      #10 0x0000556732d125aa in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7ff6261aca50, item=0x7ff6261af918) at /data/src/10.1/sql/item.h:3654
      #11 0x0000556732d125ec in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7ff6261aca50, argc=3, argv=0x7ff6261acb30) at /data/src/10.1/sql/item.h:3665
      #12 0x000055673303f2f6 in Item_func_nullif::update_used_tables (this=0x7ff6261ac9b0) at /data/src/10.1/sql/item_cmpfunc.cc:2602
      #13 0x0000556732dba2ab in st_select_lex::update_used_tables (this=0x7ff6261ab858) at /data/src/10.1/sql/sql_lex.cc:4187
      #14 0x0000556732e02bef in JOIN::optimize_inner (this=0x7ff626043278) at /data/src/10.1/sql/sql_select.cc:1115
      #15 0x0000556732e02926 in JOIN::optimize (this=0x7ff626043278) at /data/src/10.1/sql/sql_select.cc:1058
      #16 0x0000556732e0b07a in mysql_select (thd=0x7ff627cd5070, rref_pointer_array=0x7ff6261abb00, tables=0x7ff6261acc10, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2416184064, result=0x7ff6261ad218, unit=0x7ff6261ab158, select_lex=0x7ff6261ab858) at /data/src/10.1/sql/sql_select.cc:3462
      #17 0x0000556732e009f0 in handle_select (thd=0x7ff627cd5070, lex=0x7ff6261ab090, result=0x7ff6261ad218, setup_tables_done_option=0) at /data/src/10.1/sql/sql_select.cc:388
      #18 0x0000556732dd0a6e in execute_sqlcom_select (thd=0x7ff627cd5070, all_tables=0x7ff6261acc10) at /data/src/10.1/sql/sql_parse.cc:5926
      #19 0x0000556732dc6f44 in mysql_execute_command (thd=0x7ff627cd5070) at /data/src/10.1/sql/sql_parse.cc:2976
      #20 0x0000556732dee782 in Prepared_statement::execute (this=0x7ff626146470, expanded_query=0x7ff630edaa00, open_cursor=false) at /data/src/10.1/sql/sql_prepare.cc:4284
      #21 0x0000556732ded5ef in Prepared_statement::execute_loop (this=0x7ff626146470, expanded_query=0x7ff630edaa00, open_cursor=false, packet=0x0, packet_end=0x0) at /data/src/10.1/sql/sql_prepare.cc:3916
      #22 0x0000556732deb667 in mysql_sql_stmt_execute (thd=0x7ff627cd5070) at /data/src/10.1/sql/sql_prepare.cc:3042
      #23 0x0000556732dc6f75 in mysql_execute_command (thd=0x7ff627cd5070) at /data/src/10.1/sql/sql_parse.cc:2987
      #24 0x0000556732dd41c3 in mysql_parse (thd=0x7ff627cd5070, rawbuf=0x7ff626043088 "EXECUTE stmt", length=12, parser_state=0x7ff630edb5e0) at /data/src/10.1/sql/sql_parse.cc:7352
      #25 0x0000556732dc3042 in dispatch_command (command=COM_QUERY, thd=0x7ff627cd5070, packet=0x7ff62a7f9071 "EXECUTE stmt", packet_length=12) at /data/src/10.1/sql/sql_parse.cc:1477
      #26 0x0000556732dc1dc7 in do_command (thd=0x7ff627cd5070) at /data/src/10.1/sql/sql_parse.cc:1106
      #27 0x0000556732efab2b in do_handle_one_connection (thd_arg=0x7ff627cd5070) at /data/src/10.1/sql/sql_connect.cc:1330
      #28 0x0000556732efa88f in handle_one_connection (arg=0x7ff627cd5070) at /data/src/10.1/sql/sql_connect.cc:1242
      #29 0x00005567332b599e in pfs_spawn_thread (arg=0x7ff62e439ef0) at /data/src/10.1/storage/perfschema/pfs.cc:1861
      #30 0x00007ff630b5b494 in start_thread (arg=0x7ff630edcb00) at pthread_create.c:333
      #31 0x00007ff62ef1493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible with at least MyISAM and InnoDB.
      Not reproducible on 5.5, 10.0.
      No visible effect on non-debug builds.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: