COMPACT 行记录格式

时间:2024-04-04 23:35:34
CREATE TABLE `mytest` (
`t1` varchar() DEFAULT NULL,
`t2` varchar() DEFAULT NULL,
`t3` char() DEFAULT NULL,
`t4` varchar() DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
mysql> select * from mytest;
+------+------+------+------+
| t1 | t2 | t3 | t4 |
+------+------+------+------+
| a | bb | bb | ccc |
| d | ee | ee | fff |
| d | NULL | NULL | fff |
+------+------+------+------+
mysql> select hex(t1),hex(t2),hex(t3),hex(t4) from mytest;
+---------+---------+---------+---------+
| hex(t1) | hex(t2) | hex(t3) | hex(t4) |
+---------+---------+---------+---------+
| | | | |
| | | | |
| | NULL | NULL | |
+---------+---------+---------+---------+
hexdump -C mytest.ibd

COMPACT 行记录格式