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

INSERT silently ignored

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.1.21
    • 10.1.22, 10.2.5
    • Triggers
    • None
    • Ubuntu 16.04.2 LTS

    Description

      The following test case reproduces an issue where an INSERT is silently ignored by MariaDB. Rather than actually inserting the row, or reporting a foreign key error, the insert apparently succeeds with the spurious message "0 rows affected".

      Actual result from the last two INSERTs in the attached SQL script:

      Query OK, 0 rows affected (0.00 sec)
       
      Query OK, 0 rows affected (0.00 sec)
      

      After dropping the trigger, the INSERTs work as expected:

      Query OK, 1 row affected, 3 warnings (0.01 sec)
       
      ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test`.`supplierItems`, CONSTRAINT `supplierItems_ibfk_2` FOREIGN KEY (`itemId`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
      

      Attachments

        1. ignored_insert.sql
          3 kB
          Christian Rishøj
        2. my.cnf
          2 kB
          Christian Rishøj

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              crishoj Christian Rishøj
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.