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

Duplicate key value is silently truncated to 64 characters in print_keydup_error

Details

    Description

      When a duplicate key is encountered, the error message is constructed in print_keydup_error:

      https://github.com/MariaDB/server/blob/mariadb-10.2.27/sql/handler.cc#L3450

      The duplicate value is silently truncated to 64 characters. This is because the format string for the error message sets the field width to 64:

      https://github.com/MariaDB/server/blob/mariadb-10.2.27/sql/share/errmsg-utf8.txt#L6166

      Truncation is probably fine, but since this specific error involves a "duplicate key", it can be a bit confusing if the user searches the table for that string, and then doesn't find another row with that specific value.

      If we can't print the whole value, then the error message may want to mention that the string may be truncated to 64 characters.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Oleksandr Byelkin made transition -
            Open In Progress
            161d 11h 9m 1
            Oleksandr Byelkin made transition -
            In Progress Stalled
            20d 1h 41m 1
            Oleksandr Byelkin made transition -
            Stalled In Progress
            5s 2
            Oleksandr Byelkin made transition -
            In Progress In Review
            4d 18h 39m 2
            Sergei Golubchik made transition -
            In Review Stalled
            4d 11h 38m 2
            Oleksandr Byelkin made transition -
            Stalled Closed
            6d 16h 19m 1

            People

              sanja Oleksandr Byelkin
              GeoffMontee Geoff Montee (Inactive)
              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.