Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.2.12
    • Fix Version/s: 5.2.13
    • Component/s: None
    • Labels:
      None

      Gliffy Diagrams

        Attachments

          Activity

          Hide
          sanja Oleksandr Byelkin added a comment -

          I checked description of the MySQL bug, and tried to merge the patch, it does not work (maybe wrong merge).

          Show
          sanja Oleksandr Byelkin added a comment - I checked description of the MySQL bug, and tried to merge the patch, it does not work (maybe wrong merge).
          Hide
          sanja Oleksandr Byelkin added a comment -

          Need to talk to Timour about the problem.

          Show
          sanja Oleksandr Byelkin added a comment - Need to talk to Timour about the problem.
          Hide
          sanja Oleksandr Byelkin added a comment -

          reassiginig as we decided on IRC

          Show
          sanja Oleksandr Byelkin added a comment - reassiginig as we decided on IRC
          Hide
          timour Timour Katchaounov added a comment -

          I am not sure if MtSQL's fix is correct, but it is incomplete for sure. If the PK is changed to be only over 1 column, MySQL 5.6 produces the same incorrect result.
          Example:

          CREATE TABLE t1 (pk INT NOT NULL, i INT);
          INSERT INTO t1 VALUES (0,10), (1,20), (2,30), (3,40);

          CREATE TABLE t2b (pk INT NOT NULL, i INT NOT NULL, PRIMARY KEY);
          INSERT INTO t2b VALUES (0,0), (1,1), (2,2), (3,3);

          EXPLAIN
          SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk);
          SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk);
          SELECT t1.pk, NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk) FROM t1;

          Show
          timour Timour Katchaounov added a comment - I am not sure if MtSQL's fix is correct, but it is incomplete for sure. If the PK is changed to be only over 1 column, MySQL 5.6 produces the same incorrect result. Example: CREATE TABLE t1 (pk INT NOT NULL, i INT); INSERT INTO t1 VALUES (0,10), (1,20), (2,30), (3,40); CREATE TABLE t2b (pk INT NOT NULL, i INT NOT NULL, PRIMARY KEY ); INSERT INTO t2b VALUES (0,0), (1,1), (2,2), (3,3); EXPLAIN SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk); SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk); SELECT t1.pk, NULL NOT IN (SELECT t2b.i FROM t2b WHERE t2b.pk = t1.pk) FROM t1;
          Hide
          timour Timour Katchaounov added a comment -

          I am trying to understand if MySQL's solution is just incomplete, and the above case needs a separate solution, or if there is some generic solution that will address all cases.

          Show
          timour Timour Katchaounov added a comment - I am trying to understand if MySQL's solution is just incomplete, and the above case needs a separate solution, or if there is some generic solution that will address all cases.
          Hide
          timour Timour Katchaounov added a comment -
          • Re-merged after Monty's push
          • Wasted some time to analyze a failure in ps-protocol mode of view.test, found out it fails in main 5.5, at the same time I didn't see the failure in buildbot.
          • Pushed the merge into 5.5
          Show
          timour Timour Katchaounov added a comment - Re-merged after Monty's push Wasted some time to analyze a failure in ps-protocol mode of view.test, found out it fails in main 5.5, at the same time I didn't see the failure in buildbot. Pushed the merge into 5.5

            People

            • Assignee:
              timour Timour Katchaounov
              Reporter:
              sanja Oleksandr Byelkin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 7 hours
                3d 7h