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

CHARACTER_MAXIMUM_LENGTH is equal to CHARACTER_OCTET_LENGTH for utf8mb4 TEXT columns

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • N/A
    • Data types
    • None

    Description

      My understanding is that CHARACTER_MAXIMUM_LENGTH is how many characters a field can have, while CHARACTER_OCTET_LENGTH is the actual size in bytes (x3, x4) based on the charset.

      Below is a screenshot of information_schema.COLUMNS:

      VARCHAR(80) utf8mb4 allows for 80 characters, but the contents may take longer than 80 bytes in storage.

      However, a TEXT utf8mb4 doesn't seem to allow for contents longer than 65535 bytes. Accepts 65535 ASCII characters, but not Emoji, for example.

      Is this related to the inconsistency of the numbers in the screenshot?

      Attachments

        Activity

          People

            serg Sergei Golubchik
            nunop Nuno
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.