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

Upgrade from MySQL to MariaDB breaks already created views

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.0.14
    • 5.5.43, 10.0.18
    • Views
    • 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.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Oleksandr Byelkin made transition -
            Open In Progress
            19d 18h 54m 1
            Sergei Golubchik made transition -
            Stalled In Review
            1h 6m 1
            Oleksandr Byelkin made transition -
            In Progress Stalled
            24d 36m 4
            Oleksandr Byelkin made transition -
            Stalled In Progress
            54d 13h 52m 6
            Oleksandr Byelkin made transition -
            In Progress In Review
            8d 5h 34m 3
            Sergei Golubchik made transition -
            In Review Stalled
            77d 14h 34m 4
            Sergei Golubchik made transition -
            Stalled Closed
            3d 14h 43m 1

            People

              serg Sergei Golubchik
              pivanof Pavel Ivanov
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.