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

SIGSEGV in Item::print_parenthesised | Item_cond::print

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5, 10.6, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2
    • 10.4, 10.5, 10.6, 10.11, 11.1
    • None
    • None

    Description

      CREATE FUNCTION f (x INT) RETURNS INT RETURN EXISTS (( (SELECT * FROM t WHERE x=a AND a<=4)));
      CREATE TABLE t (a INT);
      SELECT f (1288477526)<f (1288481125);
      SHOW FUNCTION CODE f;
      

      Leads to:

      11.2.0 e81fa345020ec6a067583db6a7019d6404b26f93 (Debug)

      Core was generated by `/test/MD270723-mariadb-11.2.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  Item::print_parenthesised (this=this@entry=0x8f8f8f8f8f8f8f8f,
          str=str@entry=0x150e381464a0,
          query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF,
          parent_prec=AND_PRECEDENCE) at /test/11.2_dbg/sql/item.cc:495
      [Current thread is 1 (Thread 0x150e38148700 (LWP 1741366))]
      (gdb) bt
      #0  Item::print_parenthesised (this=this@entry=0x8f8f8f8f8f8f8f8f, str=str@entry=0x150e381464a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF, parent_prec=AND_PRECEDENCE) at /test/11.2_dbg/sql/item.cc:495
      #1  0x000055984fd59419 in Item_cond::print (this=0x150dfc0468a0, str=0x150e381464a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/11.2_dbg/sql/item_cmpfunc.cc:5388
      #2  0x000055984fa8f607 in st_select_lex::print (this=0x150dfc0426c0, thd=thd@entry=0x150dfc000d48, str=str@entry=0x150e381464a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/11.2_dbg/sql/sql_select.cc:31156
      #3  0x000055984fe1dfb8 in subselect_single_select_engine::print (this=0x150dfc046498, str=0x150e381464a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/11.2_dbg/sql/item_subselect.cc:4668
      #4  0x000055984fe1eb1d in Item_subselect::print (this=this@entry=0x150dfc0462f0, str=str@entry=0x150e381464a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/11.2_dbg/sql/item_subselect.cc:1081
      #5  0x000055984fe1ee82 in Item_exists_subselect::print (this=0x150dfc0462f0, str=0x150e381464a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/11.2_dbg/sql/item_subselect.cc:1606
      #6  0x000055984fc127b4 in sp_instr_freturn::print (this=0x150dfc046558, str=0x150e381464a0) at /test/11.2_dbg/sql/sp_instr.cc:1404
      #7  0x000055984f94d574 in sp_head::show_routine_code (this=0x150dfc041590, thd=thd@entry=0x150dfc000d48) at /test/11.2_dbg/sql/sp_head.cc:3341
      #8  0x000055984fa1185f in mysql_execute_command (thd=thd@entry=0x150dfc000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.2_dbg/sql/sql_parse.cc:5543
      #9  0x000055984f9fb73b in mysql_parse (thd=thd@entry=0x150dfc000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150e381472c0) at /test/11.2_dbg/sql/sql_parse.cc:7800
      #10 0x000055984fa08c00 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150dfc000d48, packet=packet@entry=0x150dfc00af49 "", packet_length=packet_length@entry=20, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_class.h:1374
      #11 0x000055984fa0b0b8 in do_command (thd=0x150dfc000d48, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1405
      #12 0x000055984fb70717 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5598527f3c18, put_in_cache=put_in_cache@entry=true) at /test/11.2_dbg/sql/sql_connect.cc:1445
      #13 0x000055984fb70be6 in handle_one_connection (arg=0x5598527f3c18) at /test/11.2_dbg/sql/sql_connect.cc:1347
      #14 0x0000150e64e16609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #15 0x0000150e64a02133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.31 (dbg), 10.5.22 (dbg), 10.6.15 (dbg), 10.9.8 (dbg), 10.10.6 (dbg), 10.11.5 (dbg), 11.0.2 (dbg), 11.0.3 (dbg), 11.1.2 (dbg), 11.2.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.31 (opt), 10.5.22 (opt), 10.6.15 (opt), 10.9.8 (opt), 10.10.6 (opt), 10.11.5 (opt), 11.0.3 (opt), 11.1.2 (opt), 11.2.0 (opt)

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.