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

VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535

    Details

    • Sprint:
      5.5.58

      Description

      As pointed out here: https://github.com/bitcoin-abe/bitcoin-abe/issues/227#issuecomment-322396729

      Maria auto-convert large VARBINARY to BLOB when they exceed maximum VARBINARY length, but for length 65533, 65534 and 65535 Maria refuses to create the column and fails to convert to BLOB

      It does convert to blob when length is >65535. For the broken ones it seems it doesn't take into account 3 bytes overhead (BTW I would expect 2... why the 3rd?)

      Example:

      MariaDB [abe_test]> CREATE TABLE t1 (c1 VARBINARY(65532)); DROP TABLE IF EXISTS t1;
      Query OK, 0 rows affected (1.95 sec)
       
      Query OK, 0 rows affected (0.29 sec)
       
      MariaDB [abe_test]> CREATE TABLE t1 (c1 VARBINARY(65533)); DROP TABLE IF EXISTS t1;
      ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
      Query OK, 0 rows affected, 1 warning (0.00 sec)
       
      MariaDB [abe_test]> CREATE TABLE t1 (c1 VARBINARY(65534)); DROP TABLE IF EXISTS t1;
      ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
      Query OK, 0 rows affected, 1 warning (0.00 sec)
       
      MariaDB [abe_test]> CREATE TABLE t1 (c1 VARBINARY(65535)); DROP TABLE IF EXISTS t1;
      ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
      Query OK, 0 rows affected, 1 warning (0.00 sec)
       
      MariaDB [abe_test]> CREATE TABLE t1 (c1 VARBINARY(65536)); DROP TABLE IF EXISTS t1;
      Query OK, 0 rows affected, 1 warning (0.94 sec)
       
      Query OK, 0 rows affected (0.14 sec)
       
      MariaDB [abe_test]> 
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                dermoth Thomas Guyot-Sionnest
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: