Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-2778

In MySQL when having a FK on delete cascade, DBZ does not report delete event for the cascade deletes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • None
    • mysql-connector
    • None
    • False
    • False
    • Undefined

    Description

      In MySQL when having a FK between two tables with ON DELETE CASCADE, Dbz is not reporting events for the cascade delete. If this is the expected behaviour, please ignore this report.

      Steps to reproduce it.

      Create master and detail tables, with details having a FK to master with ON DELETE CASCADE: 

      CREATE TABLE master (
        id INT PRIMARY KEY AUTO_INCREMENT,
        description VARCHAR(255) NOT NULL
      );
      CREATE TABLE detail (
        id INT PRIMARY KEY AUTO_INCREMENT,
        master_id INT NOT NULL,
        FOREIGN KEY (master_id)
          REFERENCES master (id)
          ON DELETE CASCADE
      );
       

      Insert one row into each table:

      insert into master (description) values ('blah');
      insert into detail (master_id) values (1);
      

      Delete master records which deletes all detail records:

      delete from master;

       When I check the topic related to detail table, there are not events for delete nor tombstone records.

       

      Thank you!

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            gborobio73 Gonzalo Borobio (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: