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

mariadb cannot import 10.3 or older mysqldump-produced dumps anymore

    XMLWordPrintable

Details

    Description

      It appears that the change in mysql.user table from table to view has broken the ability to restore older dumps produced (for example) with MariaDB 10.3 or older.

      The 10.3 dump will try to drop table user, but in 10.5 and later you cannot drop a view with "drop table" anymore (not sure when this changed).

      Hence in 10.5 you get:

      MariaDB [mysql]> DROP TABLE IF EXISTS `user`;
      Query OK, 0 rows affected, 1 warning (0.000 sec)
      MariaDB [mysql]> show warnings;
      +-------+------+------------------------+
      | Level | Code | Message                |
      +-------+------+------------------------+
      | Note  | 1965 | 'mysql.user' is a view |
      +-------+------+------------------------+
      1 row in set (0.000 sec)
      

      But in the 10.3 dump you have:

      --
      -- Table structure for table `user`
      --
       
      DROP TABLE IF EXISTS `user`;
      /*!40101 SET @saved_cs_client     = @@character_set_client */;
      /*!40101 SET character_set_client = utf8 */;
      CREATE TABLE `user` (
        `Host` char(60) NOT NULL DEFAULT '',
        `User` char(80) NOT NULL DEFAULT '',
        `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
        `Select_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
        `Insert_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
        `Update_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
      [ ... ]
      

      I would recommend we revert the change that disabled "drop table" for view, in the sake of compatibility.

      Thanks,
      Rick

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              rpizzi Rick Pizzi
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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