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

            GeoffMontee Geoff Montee (Inactive) created issue -
            GeoffMontee Geoff Montee (Inactive) made changes -
            Field Original Value New Value
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Labels beginner-friendly
            GeoffMontee Geoff Montee (Inactive) made changes -
            julien.fritsch Julien Fritsch made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            serg Sergei Golubchik made changes -
            Assignee Oleksandr Byelkin [ sanja ]
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            sanja Oleksandr Byelkin made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Comment [ commit 11363b44d58ababaef89524d3caca368d04e589a (HEAD -> bb-10.2-release, origin/bb-10.2-release)
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Mon Mar 16 16:53:10 2020 +0100

                MDEV-20604: Duplicate key value is silently truncated to 64 characters in print_keydup_error
                
                Added indication of truncated string with special width/precission suffix ':'.

            ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Component/s OTHER [ 10125 ]
            Fix Version/s 10.2.32 [ 24221 ]
            Fix Version/s 10.3.23 [ 24222 ]
            Fix Version/s 10.4.13 [ 24223 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            Labels beginner-friendly ServiceNow beginner-friendly
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            Labels ServiceNow beginner-friendly 76qDvLB8Gju6Hs7nk3VY3EX42G795W5z beginner-friendly
            serg Sergei Golubchik made changes -
            Labels 76qDvLB8Gju6Hs7nk3VY3EX42G795W5z beginner-friendly beginner-friendly
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 99692 ] MariaDB v4 [ 156753 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 201658 136328
            Zendesk active tickets 201658

            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.