Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: N/A
    • Fix Version/s: 5.5
    • Component/s: None
    • Labels:
      None

      Description

      MySQL 5.5.29 has a patch backported from MySQL 5.6, that supposedly fixes a bug.

      The test case for this bugfix is wrong, it doesn't exercise the changed code. We need to fix the test case to see if there's a genuine bug, and apply the MySQL fix, if it's good.

      The patch is attached.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              psergey Sergei Petrunia added a comment -

              "Changeset in 5.5 with the test case" is actually in 5.6

              Show
              psergey Sergei Petrunia added a comment - "Changeset in 5.5 with the test case" is actually in 5.6
              Hide
              psergey Sergei Petrunia added a comment -

              If I take the cset "tor.didriksen@oracle.com-20110825105434-ll28zinu0nhazt3z", undo the changes in sql_select.cc (so that changes in other files remain, we get the added asserts and new testcases), and after that run the testsuite, I get:

              mysqld: /home/psergey/dev2/mysql-5.6-r3404/sql/uniques.cc:587: bool Unique::get(TABLE*): Assertion `table->sort.record_pointers == __null' failed.

              Show
              psergey Sergei Petrunia added a comment - If I take the cset "tor.didriksen@oracle.com-20110825105434-ll28zinu0nhazt3z", undo the changes in sql_select.cc (so that changes in other files remain, we get the added asserts and new testcases), and after that run the testsuite, I get: mysqld: /home/psergey/dev2/mysql-5.6-r3404/sql/uniques.cc:587: bool Unique::get(TABLE*): Assertion `table->sort.record_pointers == __null' failed.
              Hide
              psergey Sergei Petrunia added a comment -

              If I

              • take the fix for mysql-5.5
              • remove all changes except the assert statements
              • add a testcase from the fix for 5.6
                I get assertion failures
              Show
              psergey Sergei Petrunia added a comment - If I take the fix for mysql-5.5 remove all changes except the assert statements add a testcase from the fix for 5.6 I get assertion failures
              Hide
              psergey Sergei Petrunia added a comment -

              There is another bugfix that is related to MySQL BUG#12694872:

              Bug#13340270: assertion table->sort.record_pointers == __null

              bug#12694872 fixed a memory leak in Unique::get(), but did not expect
              Unique::get() to be called twice before the end of the query, where
              buffers are freed.

              Show
              psergey Sergei Petrunia added a comment - There is another bugfix that is related to MySQL BUG#12694872: Bug#13340270: assertion table->sort.record_pointers == __null bug#12694872 fixed a memory leak in Unique::get(), but did not expect Unique::get() to be called twice before the end of the query, where buffers are freed.
              Hide
              elenst Elena Stepanova added a comment -

              For a note, we have a 5.3 bug apparently with a similar valgrind warning: MDEV-5623.
              The test case there is for Aria, but it can be tweaked to be valid for MyISAM as well, e.g.

              SET optimizer_switch = 'index_merge=on,index_merge_sort_union=on,derived_merge=on,in_to_exists=on';
              
              
              CREATE TABLE t1 (a INT, b INT, c VARCHAR(1), INDEX(a), INDEX(c)) ENGINE=MyISAM;
              INSERT INTO t1 VALUES 
              (5,6,'z'),(2,6,'c'),(0,8,'a'),(1,2,'q'),(8,6,'y'),
              (1,8,'y'),(1,3,'r'),(9,3,'v'),(1,9,'z'),(5,6,'r');
              
              CREATE TABLE t2 (d VARCHAR(1), INDEX(d)) ENGINE=MyISAM;
              INSERT INTO t2 VALUES ('x'),('a');
              
              CREATE TABLE t3 (e VARCHAR(1)) ENGINE=MyISAM;
              INSERT INTO t3 VALUES ('x'),('d');
              
              PREPARE stmt FROM "
              SELECT t1.* FROM t1 FORCE INDEX (c,a)
              LEFT JOIN ( 
                SELECT * FROM t2 
                WHERE EXISTS ( SELECT * FROM t3 WHERE e != d ) 
              ) AS sq ON (sq.d = c ) 
              WHERE c < 'p' OR a > 43 
              ORDER BY t1.b
              ";
              
              EXECUTE stmt;
              EXECUTE stmt;
              

              However, I am not getting the valgrind failure with it on a prefixed MySQL 5.5/5.6, so I guess it's not exactly the same.

              Show
              elenst Elena Stepanova added a comment - For a note, we have a 5.3 bug apparently with a similar valgrind warning: MDEV-5623 . The test case there is for Aria, but it can be tweaked to be valid for MyISAM as well, e.g. SET optimizer_switch = 'index_merge=on,index_merge_sort_union=on,derived_merge=on,in_to_exists=on'; CREATE TABLE t1 (a INT, b INT, c VARCHAR(1), INDEX(a), INDEX(c)) ENGINE=MyISAM; INSERT INTO t1 VALUES (5,6,'z'),(2,6,'c'),(0,8,'a'),(1,2,'q'),(8,6,'y'), (1,8,'y'),(1,3,'r'),(9,3,'v'),(1,9,'z'),(5,6,'r'); CREATE TABLE t2 (d VARCHAR(1), INDEX(d)) ENGINE=MyISAM; INSERT INTO t2 VALUES ('x'),('a'); CREATE TABLE t3 (e VARCHAR(1)) ENGINE=MyISAM; INSERT INTO t3 VALUES ('x'),('d'); PREPARE stmt FROM " SELECT t1.* FROM t1 FORCE INDEX (c,a) LEFT JOIN ( SELECT * FROM t2 WHERE EXISTS ( SELECT * FROM t3 WHERE e != d ) ) AS sq ON (sq.d = c ) WHERE c < 'p' OR a > 43 ORDER BY t1.b "; EXECUTE stmt; EXECUTE stmt; However, I am not getting the valgrind failure with it on a prefixed MySQL 5.5/5.6, so I guess it's not exactly the same.

                People

                • Assignee:
                  psergey Sergei Petrunia
                  Reporter:
                  serg Sergei Golubchik
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: