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

Mysqldump - INVISIBLE column error

    XMLWordPrintable

    Details

      Description

      Hello,
      when a table contains a INVISIBLE column having
      DEFAULT current_timestamp() ON UPDATE current_timestamp()
      the mysqldump is not reporting the complete insert as it does having only
      DEFAULT current_timestamp().

      here the use case:

       
      CREATE TABLE `table1` (
        `id` int(11) NOT NULL,
        `name` varchar(20) DEFAULT NULL,
        `lastedatet` datetime NOT NULL INVISIBLE DEFAULT current_timestamp()
      ) ENGINE=InnoDB;
       
      insert into table1 (id,name) values (1,'andre');
       
      CREATE TABLE `table2` (
        `id` int(11) NOT NULL,
        `name` varchar(20) DEFAULT NULL,
        `lastedatet` datetime NOT NULL INVISIBLE DEFAULT current_timestamp() ON UPDATE current_timestamp()
      ) ENGINE=InnoDB;
       
      insert into table2 (id,name) values (1,'andre');
       
       
      [root@m1 ~]# mysqldump andre table1 | grep INSERT
      INSERT INTO `table1` (`id`, `name`, `lastedatet`) VALUES (1,'andre','2022-04-07 10:33:01');
       
      [root@m1 ~]# mysqldump andre table2 | grep INSERT
      INSERT INTO `table2` VALUES (1,'andre','2022-04-07 10:33:36');
      

      The dump on table2 is not reporting the complete insert and when
      importing this table is giving error:

      INSERT INTO `table2` VALUES (1,'andre','2022-04-07 10:33:36');
      ERROR 1136 (21S01): Column count doesn't match value count at row 1
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              aponzo Andrea Ponzo
              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.