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

Error 1062 reported on insert after deletion of all table tuples

    XMLWordPrintable

Details

    Description

      The error 1062 (Duplicate entry) was reported when trying to insert tuple immediately after deleting all table tuples (The delete operation has been commited via mysql_query C API before insert):

      at 89661187
      #230322 7:46:48 server id 1 end_log_pos 89661299 CRC32 0x6f24d9f8 Query thread_id=451878 exec_time=0 error_code=0
      SET TIMESTAMP=1679471208/!/;
      delete from appcnfg.sipia_port_status

      +++ 2023/03/22 07:46:48.549 FAULT HIGH dbload:4023999 E:7128 S:1 (MariadbTran.cpp 1536 v-0001 169.254.64.1 oam-a)

      Error: Statement 'insert into appcnfg.sipia_port_status (node_id, port_name, filler1, port_type, administrative_state, service_state) values (320, 'ecsf-stdn', 0, 10, 1, 1);' failed, rc = 1.
      Error Number:1062; Error String:Duplicate entry '320-ecsf-stdn' for key 'PRIMARY'.

      Is it possible that the delete operation has not been fully committed (even mysql_query ("commit") returned success) while the insert comes? How to ensure a clean start for insert?

      Attachments

        Activity

          People

            Unassigned Unassigned
            liberiul Andy Liu
            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.