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

Crash if a FETCH statement produces warnings

    XMLWordPrintable

Details

    • 10.2.7-1

    Description

      The script that is reported in MDEV-12377 causes a crash in 10.2.
      This only happens if FETCH causes warnings. If I modify the data in the below script not to have the trailing 'x' character in the column t1.b, the crash goes away.

      SET sql_mode=default;
      DROP TABLE IF EXISTS t1;
      DROP PROCEDURE IF EXISTS p1;
       
      CREATE TABLE t1 (a INT, b VARCHAR(10));
      INSERT INTO t1 VALUES (10,'11x');
      INSERT INTO t1 VALUES (10,'12x');
       
      DELIMITER $$;
      CREATE PROCEDURE p1()
      BEGIN
        DECLARE cur1 CURSOR FOR SELECT b FROM t1;
          BEGIN
          DECLARE res int;
          OPEN cur1;
          FETCH cur1 INTO res;
          CLOSE cur1;
        END;
      END;
      $$
      DELIMITER ;$$
       
      CALL p1();
      SHOW WARNINGS;
      

      This is a stack trace:

      #0  0x00007ffff5994a28 in raise () from /lib64/libc.so.6
      #1  0x00007ffff599662a in abort () from /lib64/libc.so.6
      #2  0x00007ffff598d227 in __assert_fail_base () from /lib64/libc.so.6
      #3  0x00007ffff598d2d2 in __assert_fail () from /lib64/libc.so.6
      #4  0x0000555555acbc73 in Diagnostics_area::set_ok_status (
          this=0x7ffec6c1b058, affected_rows=0, last_insert_id=0, message=0x0)
          at /home/bar/maria-git/server.10.2/sql/sql_error.cc:380
      #5  0x0000555555a7f855 in my_ok (thd=0x7ffec6c16070, affected_rows=0, id=0, 
          message=0x0) at /home/bar/maria-git/server.10.2/sql/sql_class.h:4319
      #6  0x0000555555af67ab in do_execute_sp (thd=0x7ffec6c16070, sp=0x7ffec6d80088)
          at /home/bar/maria-git/server.10.2/sql/sql_parse.cc:2891
      #7  0x0000555555aff7a1 in mysql_execute_command (thd=0x7ffec6c16070)
          at /home/bar/maria-git/server.10.2/sql/sql_parse.cc:5771
      #8  0x0000555555b05c29 in mysql_parse (thd=0x7ffec6c16070, 
          rawbuf=0x7ffec6c63088 "CALL p1()", length=9, parser_state=0x7ffff7f2dd20, 
          is_com_multi=false, is_next_command=false)
          at /home/bar/maria-git/server.10.2/sql/sql_parse.cc:7858
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.