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

LP:1002126 - Assertion abort on SELECT @user_var

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3.10, 5.2.13
    • Component/s: None
    • Labels:

      Description

      The following test case causes an assertion abort in MariaDB 5.2:

      CREATE TABLE t1(a INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (0);
      SELECT DISTINCT POW(COUNT(*), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON @a))
      AS b FROM t1 GROUP BY a;
      SELECT @a;
      DROP TABLE t1;
      CREATE TABLE t1(f1 INT, f2 INT);
      INSERT INTO t1 VALUES (1,2),(2,3),(3,1);
      CREATE TABLE t2(a INT);
      INSERT INTO t2 VALUES (1);
      SET @var=NULL;
      SELECT @var:=(SELECT f2 FROM t2 WHERE @var) FROM t1 GROUP BY f1 ORDER BY f2 DESC
      LIMIT 1;
      SELECT @var;
      DROP TABLE t1, t2;
      

      The is no problem here with MaraiDB 5.5 though.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            sanja Oleksandr Byelkin added a comment -

            I have strong feeling that both patches are wrong (checking...)

            Show
            sanja Oleksandr Byelkin added a comment - I have strong feeling that both patches are wrong (checking...)
            Hide
            sanja Oleksandr Byelkin added a comment -

            The MySQL workaround looks like the best. Playing with aggregate functions and split_sum* looks even more hackish.

            Show
            sanja Oleksandr Byelkin added a comment - The MySQL workaround looks like the best. Playing with aggregate functions and split_sum* looks even more hackish.
            Hide
            sanja Oleksandr Byelkin added a comment -

            Fix commited.

            Show
            sanja Oleksandr Byelkin added a comment - Fix commited.
            Hide
            serg Sergei Golubchik added a comment -

            review: looks ok!

            Show
            serg Sergei Golubchik added a comment - review: looks ok!
            Hide
            timour Timour Katchaounov added a comment -

            The patch has been pushed to 5.2, and 5.3.

            Show
            timour Timour Katchaounov added a comment - The patch has been pushed to 5.2, and 5.3.

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                igor Igor Babaev
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: