BIT 数据类型用于存储位值。类型 BIT( 可以存储 M)M 位的值。M 的范围是 1 到 64。The BIT data type is used to store bit
values. A type of
BIT( enables
storage of M)M-bit values.
M can range from 1 to 64.
要指定位值,可以使用 b' 表示法。value'value 是用零和一表示的二进制值。例如,b'111' 和 b'10000000' 分别表示 7 和 128。参见 第 11.1.5 节,“位值文字”。To specify bit values,
b' notation
can be used. value'value is a binary value
written using zeros and ones. For example,
b'111' and b'10000000'
represent 7 and 128, respectively. See
Section 11.1.5, “Bit-Value Literals”.
如果你为 BIT( 列分配的值少于 M)M 位,该值将在左侧用零填充。例如,将值 b'101' 分配给 BIT(6) 列,实际上等同于分配 b'000101'。If you assign a value to a
BIT( column that
is less than M)M bits long, the value
is padded on the left with zeros. For example, assigning a value
of b'101' to a BIT(6)
column is, in effect, the same as assigning
b'000101'.
NDB 集群。 在给定的 NDB 表中使用的所有 BIT 列的最大总大小不得超过 4096 位。NDB Cluster.
The maximum combined size of all BIT
columns used in a given NDB table
must not exceed 4096 bits.