← Back to team overview

maria-discuss team mailing list archive

Re: columns compression

 

Same to TEXT

MariaDB [test]>
*CREATE TABLE `table_compressed2` (*
*    ->   `id` int(11) NOT NULL DEFAULT 0,*
*    ->   `gmtime` decimal(22,7) NOT NULL DEFAULT 0.0000000,*
*    ->   `data` text COMPRESSED NOT NULL DEFAULT '',*
*    ->   PRIMARY KEY (`id`,`gmtime`)*
*    -> )  ENGINE=InnoDB DEFAULT CHARSET=latin1;*
*Query OK, 0 rows affected (0.231 sec)*

MariaDB [test]> *CREATE TABLE `table_without_compression2` (*
*    ->   `id` int(11) NOT NULL DEFAULT 0,*
*    ->   `gmtime` decimal(22,7) NOT NULL DEFAULT 0.0000000,*
*    ->   `data` text NOT NULL,*
*    ->   PRIMARY KEY (`id`,`gmtime`)*
*    -> )  ENGINE=InnoDB DEFAULT CHARSET=latin1;*
*Query OK, 0 rows affected (0.253 sec)*


MariaDB [test]> *INSERT INTO table_without_compression2 VALUES
(1,0,repeat('a',65535));*
*Query OK, 1 row affected (0.061 sec)*

MariaDB [test]> *INSERT INTO table_without_compression2 VALUES
(1,0,repeat('a',65536));*
*ERROR 1406 (22001): Data too long for column 'data' at row 1   <- JUST TO
CHECK IF WE GOT MAX SIZE OF BLOB COLUMN*

MariaDB [test]> *INSERT INTO table_compressed2 SELECT * FROM
table_without_compression2;*
*ERROR 1406 (22001): Data too long for column 'data' at row 1*

Follow ups

References