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

Backup of VIRTUALS colums is represented in restore

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.6.14
    • None
    • Backup
    • None

    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

        Activity

          People

            Unassigned Unassigned
            Desdic Kim Gert Nielsen
            Votes:
            1 Vote for this issue
            Watchers:
            3 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.