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

Backup of VIRTUALS colums is represented in restore

Details

    Description

      When doing a backup of a table with a virtual colum (GENERATED ALWAYS) the mysqldump tools fails to see its a generated column and adds it to the restore

      example

      CREATE TABLE example(
              firstname VARCHAR(255),
              lastname VARCHAR(255),
              fullname VARCHAR(512) AS (CONCAT(firstname, ' ', lastname)) VIRTUAL
      );
       
      insert into example(firstname, lastname) values('Donald', 'Duck');
      

      then a mysqldump --opt generates

      LOCK TABLES `example` WRITE;
      /*!40000 ALTER TABLE `example` DISABLE KEYS */;
      INSERT INTO `example` VALUES ('Donald','Duck','Donald Duck');
      /*!40000 ALTER TABLE `example` ENABLE KEYS */;
      UNLOCK TABLES;
      /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
      

      It should actually ignore it since its generated.

      The example above is very simple but we have seen issues with restoring due to this.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Sergei Golubchik made transition -
            Open In Progress
            502d 6h 52m 1
            Sergei Golubchik made transition -
            In Progress In Review
            6s 1
            Sergei Golubchik made transition -
            In Review Stalled
            30d 1h 17m 1
            Sergei Golubchik made transition -
            Stalled Needs Feedback
            4s 1
            Julien Fritsch made transition -
            Needs Feedback Closed
            31d 16h 39m 1

            People

              serg Sergei Golubchik
              Desdic Kim Gert Nielsen
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.