11.1.5 Bit-Value Type位值类型 - BIT

The BIT data type is used to store bit values. BIT数据类型用于存储位值。A type of BIT(M) enables storage of M-bit values. BIT(M)的类型允许存储M位值。M can range from 1 to 64.M的范围从1到64。

To specify bit values, b'value' notation can be used. 要指定位值,可以使用b'value'表示法。value is a binary value written using zeros and ones. value是用0和1写的二进制值。For example, b'111' and b'10000000' represent 7 and 128, respectively. 例如,b'111'b'10000000'分别表示7和128。See Section 9.1.5, “Bit-Value Literals”.请参见第9.1.5节,“位值文字”

If you assign a value to a BIT(M) column that is less than M bits long, the value is padded on the left with zeros. 如果将一个值赋给长度小于M位的BIT(M)列,则该值在左侧用零填充。For example, assigning a value of b'101' to a BIT(6) column is, in effect, the same as assigning b'000101'.例如,将b'101'的值赋给BIT(6)列实际上与赋值b'000101'相同。

NDB Cluster.  The maximum combined size of all BIT columns used in a given NDB table must not exceed 4096 bits.给定NDB表中使用的所有BIT列的最大组合大小不得超过4096位。