mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-22 08:20:48 +00:00
9aa6c7053f
* add dataTypes zh translate --> init docs * add dataTypes zh translate * finish dataTypes zh translate * fix punctuation in dataTypes zh translate
10 lines
726 B
Markdown
10 lines
726 B
Markdown
# FixedString(N)
|
||
|
||
固定长度 N 的字符串。N 必须是严格的正自然数。
|
||
当服务端读取长度小于 N 的字符串时候(例如解析 INSERT 数据时),通过在字符串末尾添加空字节来达到 N 字节长度。
|
||
当服务端读取长度大于 N 的字符串时候,将返回错误消息。
|
||
当服务器写入一个字符串(例如,当输出 SELECT 查询的结果)时,NULL字节不会从字符串的末尾被移除,而是被输出。
|
||
注意这种方式与 MYSQL 的 CHAR 类型是不一样的(MYSQL 的字符串会以空格填充,然后输出的时候空格会被修剪)。
|
||
|
||
与 `String` 类型相比,极少的函数会使用 `FixedString(N)`,因此使用起来不太方便。
|