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

Allow one to specify max length for a BLOB/TEXT

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

          monty Michael Widenius created issue -
          monty Michael Widenius made changes -
          Field Original Value New Value
          Epic Link MDEV-10137 [ 56868 ]
          bar Alexander Barkov made changes -
          Summary Allow one to specicy max length for a BLOB/TEXT Allow one to specify max length for a BLOB/TEXT
          bar Alexander Barkov made changes -
          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.
          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:
          {noformat}
          <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
          {noformat}
          alvinr Alvin Richards (Inactive) made changes -
          Labels BLOB TEXT BLOB Compatibility TEXT
          alvinr Alvin Richards (Inactive) made changes -
          Epic Link MDEV-10137 [ 56868 ] MDEV-10872 [ 58182 ]
          alvinr Alvin Richards (Inactive) made changes -
          Labels BLOB Compatibility TEXT BLOB Compatibility NRE-307517 TEXT
          alvinr Alvin Richards (Inactive) made changes -
          NRE Projects NRE-307517
          alvinr Alvin Richards (Inactive) made changes -
          Labels BLOB Compatibility NRE-307517 TEXT BLOB Compatibility TEXT
          serg Sergei Golubchik made changes -
          Fix Version/s 10.2 [ 14601 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Support case ID not-26307
          ralf.gebhardt Ralf Gebhardt made changes -
          NRE Projects AC-2610/DEFERRED
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 75865 ] MariaDB v4 [ 130490 ]

          People

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

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.