Details

    Description

      In the following test case, the REPLACE statement should successfully insert data, instead of returning an error.

      CREATE TABLE t0 (c1 NUMERIC UNSIGNED NOT NULL, c2 INT3 UNIQUE, c3 BIT(2) PRIMARY KEY);
      CREATE UNIQUE INDEX i1 ON t0(c1);
      INSERT INTO t0 (c1,c2,c3) VALUES (0,0,b'01');
      INSERT INTO t0 (c1,c2,c3) VALUES (1,1,b'10');
      REPLACE INTO t0 (c1,c2,c3) VALUES (0,1,b'11'); --  Duplicate entry '0' for key 'i1'
      

      The reference test case can be obtained by defining the UNIQUE constraint in CREATE TABLE, and the same REPLACE statement successfully executed.

      CREATE TABLE t0 (c1 NUMERIC UNSIGNED NOT NULL UNIQUE, c2 INT3 UNIQUE, c3 BIT(2) PRIMARY KEY);
      INSERT INTO t0 (c1,c2,c3) VALUES (0,0,b'01');
      INSERT INTO t0 (c1,c2,c3) VALUES (1,1,b'10');
      REPLACE INTO t0 (c1,c2,c3) VALUES (0,1,b'11'); -- no errors
      

      As a result, the final table content differs because of the different ways of creating UNIQUE constraints.

      Attachments

        Activity

          Transition Time In Source Status Execution Times
          Alice Sherepa made transition -
          Open Confirmed
          1d 1h 34m 1
          Thirunarayanan Balathandayuthapani made transition -
          Confirmed In Review
          24d 20h 38m 1
          Thirunarayanan Balathandayuthapani made transition -
          Stalled In Review
          1d 22h 39m 1
          Marko Mäkelä made transition -
          In Review Stalled
          1d 21h 53m 2
          Thirunarayanan Balathandayuthapani made transition -
          Stalled Closed
          4h 36m 1

          People

            thiru Thirunarayanan Balathandayuthapani
            John Jove John Jove
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.