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

    XMLWordPrintable

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

            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.