only for RuBoard - do not distribute or recompile |
String data types store various kinds of text data. There are several types to accomodate data of different sizes. For each size, there is a type that sorts and compares entries in a case-insensitive fashion in accordance with the sorting rules for the default character set and a corresponding binary type that does simple byte-by-byte sorts and comparisons. In other words, binary values are case sensitive. For CHAR and VARCHAR, the binary types are declared using the BINARY attribute. The TEXT types, however, have corresponding BLOB types as their binary counterparts.
BLOB |
CHAR |
CHAR(size) [BINARY]
Specified by the size value in a range of to 255 (1 to 255 prior to MySQL 3.23)
size bytes
A fixed-length text field. String values with fewer characters than the column's size will be right padded with spaces. The right padding is removed on retrieval of the value from the database.
CHAR(0) fields are useful for backward compatibility with legacy systems that no longer store values in the column.
CHARACTER |
Synonym for CHAR.
CHARACTER VARYING |
Synonym for VARCHAR.
LONGBLOB |
LONGTEXT |
LONGTEXT
0 to 4,294,967,295
Length of value + 4 bytes
Storage for large text values. While the theoretical limit on the size of the text that can be stored in a LONGTEXT column exceeds 4 GB, the practical limit is much less due to limitations of the MySQL communication protocol and the amount of memory available on both the client and server ends of the communication.
MEDIUMBLOB |
MEDIUMTEXT |
MEDIUMTEXT
0 to 16,777,215
Length of value + 3 bytes
Storage for medium-sized text values.
NCHAR |
NATIONAL CHAR |
Synonym of CHAR.
NATIONAL CHARACTER |
Synonym of CHAR.
NATIONAL VARCHAR |
Synonym of VARCHAR.
TEXT |
TEXT
0 to 65,535
Length of value + 2 bytes
Storage for most text values.
TINYBLOB |
TINYTEXT |
TINYTEXT
0 to 255
Length of value + 1 byte
Storage for short text values.
VARCHAR |
VARCHAR(size) [BINARY]
Specified by the size value in a range of to 255 (1 to 255 prior to MySQL 3.23)
Length of value + 1 byte
Storage for variable-length text. Trailing spaces are removed from VARCHAR values when stored in a database that conflicts with the ANSI specification.
only for RuBoard - do not distribute or recompile |