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

Allow one to specify max length for a BLOB/TEXT

    XMLWordPrintable

    Details

      Description

      InnoDB can't handle rows that has a longer row length than 64K (this is excluding BLOB and TEXT fields).
      One solution is to convert all long VARCHAR fields to TEXT.
      The problem with this is that the length constraint one used on VARCHAR isn't supported by TEXT.

      This could be solved by allowing one to specify a max length for BLOB/TEXT.

      Inserting 100 characters in a BLOB(99) would in this case give an error.

      The relevant SQL Standard grammar:

      <character large object type> ::=
          CHARACTER LARGE OBJECT [ <left paren> <character large object length> <right paren> ]
        | CHAR LARGE OBJECT [ <left paren> <character large object length> <right paren> ]
        | CLOB [ <left paren> <character large object length> <right paren> ]
       
      <character large object length> ::=
        <large object length> [ <char length units> ]
       
      <large object length> ::=
          <length> [ <multiplier> ]
        | <large object length token>
       
       
      // Similar to <length> [ <multiplier> ] but with
      // no separators between <digit>s and <multiplier>
      <large object length token> ::=
          <digit>... <multiplier>
       
      <multiplier> ::=
          K
        | M
        | G
        | T
        | P
       
      <char length units> ::=
        CHARACTERS | OCTETS
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            monty Michael Widenius
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: