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

Increase binary datatype limitation from 255 bytes to 65536 bytes

    Details

      Description

      In a project I'm working on, binary string 'varbinary' used as fixed array. Array elements change by INSERT(str,pos,len,newstr) function. Varbinary fields filled at insert with 0x00 (the zero byte) by setting DEFAULT option to '\0\0\0 ... \0'. The problem is that in my company use such programs, as Naviсat, which clears default '\0\0\0 ... \0' value at any table edit. Alternative - use datatype 'binary', that filled with 0x00 (the zero byte) by default. But its limited by 255 bytes only, error: "1074 - Column length too big for column 'row_array' (max = 255)". It will be great if limit of binary datatype increases to 65536 bytes or more.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            Mikle Mikle added a comment - - edited

            I use this method too. In my tables contains many columns like this: `comma` varbinary(20000) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 ... \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', with repetition of zeros many thousands of times. But I think it would be more effective to use varbinary and add new INSERT(str,pos,len,newstr) function, which will padded string with zeros to pos, if pos is not within the length of the string. Or add a new syntax for accessing the elements of string, like this: UPDATE `table` SET `comma`[4] = '1111' , which will write bytes starting from specified in brackets position, with autopadded string with zeros to position...

            Show
            Mikle Mikle added a comment - - edited I use this method too. In my tables contains many columns like this: `comma` varbinary(20000) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 ... \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', with repetition of zeros many thousands of times. But I think it would be more effective to use varbinary and add new INSERT(str,pos,len,newstr) function, which will padded string with zeros to pos, if pos is not within the length of the string. Or add a new syntax for accessing the elements of string, like this: UPDATE `table` SET `comma` [4] = '1111' , which will write bytes starting from specified in brackets position, with autopadded string with zeros to position...

              People

              • Assignee:
                Unassigned
                Reporter:
                GenryU Genry Uncij
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: