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

Cross-database operation with virtual columns fails

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.2, 10.2.6
    • Fix Version/s: 10.2.7
    • Component/s: Virtual Columns
    • Labels:
      None
    • Environment:
      CentOS 6.7

      Description

      Hi, all
      we encountered a problem in 10.2.6 slave.
      we could not confirm ,it is bug or other, please experts help to confirm, thanks.

      our product server consist of a master and two slaves:
      master: MariaDB server 10.1.22
      slave1: MariaDB server 10.1.22
      slave2: MariaDB server 10.2.6 (delay slave)

      use table structure:

      CREATE TABLE dba.event_time(
        `id` INT(11) NOT NULL AUTO_INCREMENT,
        `dbname` VARCHAR(50) COLLATE utf8_bin DEFAULT NULL  ,
        `eventname` VARCHAR(50) COLLATE utf8_bin DEFAULT NULL  ,
        `startime` DATETIME DEFAULT NULL  ,
        `endtime` DATETIME DEFAULT NULL  ,
        `recdate` DATE DEFAULT NULL  ,
        `duration` INT(11) AS (timestampdiff(SECOND,startime,endtime)) PERSISTENT ,
        PRIMARY KEY (`id`),
        UNIQUE KEY `dbname` (`dbname`,`eventname`,`recdate`)
      ) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
      

      on master, after execute alter statement , slave1 could normal run.

      ALTER TABLE `dba`.`event_time`  ADD INDEX (`startime`);
      

      but ,on slave2, slave stop run ,and have some error in error log:

      2017-06-28 23:59:50 140041235142400 [ERROR] Slave SQL: Error 'Unknown column 'dba.event_time.startime' in 'GENERATED ALWAYS AS'' on query. Default database: ''. Query: 'ALTER TABLE `dba`.`event_time`  ADD INDEX (`startime`)', Gtid 0-5187-24322365258, Internal MariaDB error code: 1054
      2017-06-28 23:59:50 140041235142400 [Warning] Slave: Unknown column 'dba.event_time.startime' in 'GENERATED ALWAYS AS' Error_code: 1054
      2017-06-28 23:59:50 140041235142400 [Warning] Slave: Got an error evaluating stored expression timestampdiff(SECOND,`dba`.`event_time`.`startime`,`dba`.`event_time`.`endtime`) Error_code: 4027
      2017-06-28 23:59:50 140041235142400 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.008350' position 693638501; GTID position '0-5187-24322365257'
      

      if manual execute ALTER TABLE `dba`.`event_time` ADD INDEX (`startime`) on slave2, it could normal run.

        Attachments

          Activity

            People

            • Assignee:
              serg Sergei Golubchik
              Reporter:
              sysdljr sysdljr
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: