Oracle 5.0 Reference Manual page 1066

Table of Contents

Advertisement

display sizes are discarded.
TIMESTAMP
Also note that
TIMESTAMP
• Columns that are part of a
• Trailing spaces are automatically deleted from
created.
• MySQL maps certain data types used by other SQL database vendors to MySQL types. See
Section 11.4, "Using Data Types from Other Database
• If you include a
USING
but there is another index type available that the engine can use without affecting query results, the
engine uses the available type.
Possible data type changes are given in the following list. If a version number is given, the change
occurs only up to the versions listed. After that, an error occurs if a column cannot be created using the
specified data type.
• Before MySQL 5.0.3,
• Before MySQL 5.0.3, if any column in a table has a variable length, the entire row becomes variable-
length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or
BLOB), all
columns longer than three characters are changed to
CHAR
not affect how you use the columns in any way; in MySQL,
characters. MySQL performs this conversion because it saves space and makes table operations
faster. See
Chapter 14, Storage
• Before MySQL 5.0.3, a
is converted to the smallest
is converted to TEXT, and
VARCHAR(500)
Similar conversions occur for
type.
Note that these conversions result in a change in behavior with regard to treatment of trailing spaces.
As of MySQL 5.0.3, a
silently converted. Instead, an error occurs. From MySQL 5.0.6 on, silent conversion of
and
columns with a length specification greater than 65535 does not occur if strict SQL
VARBINARY
mode is enabled. Instead, an error occurs.
• Before MySQL 5.0.10, for a specification of DECIMAL(M,D), if
upward. For example,
is created as specified.
DECIMAL(10,10)
• Specifying the
CHARACTER SET binary
to be created as the corresponding binary data type:
VARBINARY, and
TEXT
are created as declared. Suppose that you specify a table using this definition:
CREATE TABLE t
(
c1 VARCHAR(10) CHARACTER SET binary,
c2 TEXT CHARACTER SET binary,
c3 ENUM('a','b','c') CHARACTER SET binary
);
The resulting table has this definition:
CREATE TABLE t
(
c1 VARBINARY(10),
CREATE TABLE
columns are
NOT NULL
are made
PRIMARY KEY
clause to specify an index type that is not legal for a given storage engine,
columns with a length less than four are changed to CHAR.
VARCHAR
Engines.
or
column with a length specification greater than 255
CHAR
VARCHAR
type that can hold values of the given length. For example,
TEXT
VARCHAR(200000)
and VARBINARY, except that they are converted to a
BINARY
or
column with a length specification greater than 255 is not
CHAR
BINARY
becomes DECIMAL(11,10). As of MySQL 5.0.10,
DECIMAL(10,10)
attribute for a character data type causes the column
becomes BLOB. For the
1046
Syntax
by default.
even if not declared that way.
NOT NULL
and
member values when the table is
ENUM
SET
Engines".
VARCHAR
is converted to MEDIUMTEXT.
is not larger than D, it is adjusted
M
becomes BINARY,
CHAR
and
data types, this does not occur; they
ENUM
SET
columns. This does
VARCHAR
is just a different way to store
VARCHAR
becomes
VARCHAR
BLOB

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents