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

Adding invisible SERIAL column primary key on slave break row base replication

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.6.10
    • N/A
    • Replication
    • None

    Description

      Hello

      The table with composed primary key compose on 3 varchar(256) we alter it on a replica to add invisible serial and move the primary to unique and this break the replicas on row based event

      Last_SQL_Error Column 0 of table 'varchar(765 octets)' to type 'bigint(20) unsigned 
      

      I would suggest that if a column is invisible it should be ignored from the replica in mapping a row event array to column name of the table when the event have less column count than the destination columns

      I think it may not be a bug but a documentation issue as what about auto_increment if it is affected on the replica than it's not on the leader and would produce data divergence

      Attachments

        Issue Links

          Activity

            This behaves as expected. Documentation says that

            Replication can also take place when the primary and replica have a different number of columns if the following criteria are met:

            • columns must be in the same order on the primary and replica
            • common columns must be defined with the same data type
            • extra columns must be defined after the common columns

            And you have added a column first, not last.

            Replication cannot ignore invisible columns, because in that case tables with invisible columns cannot be replicated at all.

            serg Sergei Golubchik added a comment - This behaves as expected. Documentation says that Replication can also take place when the primary and replica have a different number of columns if the following criteria are met: columns must be in the same order on the primary and replica common columns must be defined with the same data type extra columns must be defined after the common columns And you have added a column first , not last. Replication cannot ignore invisible columns, because in that case tables with invisible columns cannot be replicated at all.

            Thanks pointing out the documentation in the hope it will help others as well

            stephane@skysql.com VAROQUI Stephane added a comment - Thanks pointing out the documentation in the hope it will help others as well

            People

              serg Sergei Golubchik
              stephane@skysql.com VAROQUI Stephane
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.