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

Duplicate entry allowed into a UNIQUE column

    XMLWordPrintable

Details

    Description

      In a woocommerce install the following table is somehow allowing duplicate entries into the unique indexed column on the slave, which breaks replication as this is detected on the slave side.

      Table schema:

      CREATE TABLE `wp_067d483e_woocommerce_sessions` (
        `session_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        `session_key` char(32) NOT NULL,
        `session_value` longtext NOT NULL,
        `session_expiry` bigint(20) unsigned NOT NULL,
        PRIMARY KEY (`session_id`),
        UNIQUE KEY `session_key` (`session_key`)
      ) ENGINE=InnoDB AUTO_INCREMENT=2642 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
      

      Slave error:

      Last_SQL_Error: Could not execute Write_rows_v1 event on table grao.wp_067d483e_woocommerce_sessions; Entrada duplicada '63966' para la clave 'session_key', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log db1-bin.000001, end_log_pos 109407704
      

      Screenshot attached showing the duplicate entry, confirmed by hex that it is the same data.

      We are not sure how this is happening yet. We have been offered access to the system, I will notify the affected person of this ticket once it is created.

      I have confirmed that `unique_checks` are on.

      Attachments

        1. master.txt
          7 kB
          Javier Casares
        2. MDEV-31120.cnf
          0.7 kB
          Daniel Black
        3. MDEV-31120.test
          2 kB
          Daniel Black
        4. Screenshot_188.png
          8 kB
          Andrew Hutchings
        5. slave.txt
          7 kB
          Javier Casares

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              TheLinuxJedi Andrew Hutchings (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              14 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.