Skip to content

MySQL部分 #2639

@Xuxiusheng

Description

@Xuxiusheng

在MySQL的NULL与“”对比的那一部分写到“”是不占用空间的,但是

  1. 如果是char字段,需要填充到指定长度,是占用空间的
  2. 如果是varchar字段,其实和NULL一样是有隐藏字段来标识字段实际长度的,这个标识字段为1或2个字节,并且每个变长字段都会有一个
    所以,综上的话,其实“”字符串实际上是占用空间的

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions