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

Upgrade from MySQL to MariaDB breaks already created views

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.0.14
    • Fix Version/s: 10.0.18, 5.5.43
    • Component/s: Views
    • Labels:
      None

      Description

      If you create a view with ALGORITHM=MERGE or ALGORITHM=TEMPTABLE in MySQL 5.1 (or actually I believe in any version of MySQL) and then start MariaDB on the same data the algorithm in the view definition gets changed to the opposite one (MERGE -> TEMPTABLE and TEMPTABLE -> MERGE).

      The problem is in this commit: http://bazaar.launchpad.net/~maria-captains/maria/10.0/revision/2502.557.1 which was made in response to this bug https://bugs.launchpad.net/maria/+bug/983285.

      If you look closely comment #2 on the bug says: "In 5.2 numeric algorithm values are: undefined=0, temptable=1, merge=2." If you look at sql/table.h in the commit you'll see:

      #define VIEW_ALGORITHM_MERGE_FRM      1
      #define VIEW_ALGORITHM_TMPTABLE_FRM   2
      

      So the numeric values stored in the frm file (and thus interpretation of the values written in the frm file) got reversed and sadly nobody noticed that. Now it will break any upgrade from MySQL to MariaDB.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              sanja Oleksandr Byelkin added a comment -

              Fixes committed. It need review...

              Show
              sanja Oleksandr Byelkin added a comment - Fixes committed. It need review...
              Hide
              sanja Oleksandr Byelkin added a comment -

              revno: 4407
              revision-id: sanja@askmonty.org-20150209014828-kx3cr36hgrvjhtrg
              parent: svoj@mariadb.org-20150114135038-v50g2cul4vce63h8
              committer: sanja@askmonty.org
              branch nick: work-maria-5.5-MDEV-6916-check_view
              timestamp: Mon 2015-02-09 02:48:28 +0100
              message:
              MDEV-6916: Upgrade from MySQL to MariaDB breaks already created views

              CHECK/REPAIR commands and mysql_upgradesupport for upgrade from MySQL server support.

              Show
              sanja Oleksandr Byelkin added a comment - revno: 4407 revision-id: sanja@askmonty.org-20150209014828-kx3cr36hgrvjhtrg parent: svoj@mariadb.org-20150114135038-v50g2cul4vce63h8 committer: sanja@askmonty.org branch nick: work-maria-5.5- MDEV-6916 -check_view timestamp: Mon 2015-02-09 02:48:28 +0100 message: MDEV-6916 : Upgrade from MySQL to MariaDB breaks already created views CHECK/REPAIR commands and mysql_upgradesupport for upgrade from MySQL server support.
              Show
              danblack Daniel Black added a comment - the review: https://lists.launchpad.net/maria-developers/msg08148.html corrections based on review: https://lists.launchpad.net/maria-developers/msg08451.html
              Hide
              sanja Oleksandr Byelkin added a comment -

              Thank you a lot for the work you have made!!!
              The task is not abandoned completely I just have higher priority things, but I hope I'll have time soon to sort all this out.

              Show
              sanja Oleksandr Byelkin added a comment - Thank you a lot for the work you have made!!! The task is not abandoned completely I just have higher priority things, but I hope I'll have time soon to sort all this out.
              Hide
              sanja Oleksandr Byelkin added a comment -

              Here is a part of this bug test suite

              Show
              sanja Oleksandr Byelkin added a comment - Here is a part of this bug test suite

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  pivanof Pavel Ivanov
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  11 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 - 1 day, 2 hours
                    1d 2h