MySql implicit column description changed

Source: Internet
Author: User

In some cases, MySQL implicitly modifies a column description in a create table statement. (This may also be in alter table .) VARCHAR with a length less than 4 is changed to CHAR. If any column in a table has a variable length, the result is that the entire row is variable length. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns larger than 3 characters will be changed to VARCHAR columns. This does not affect how you use columns in any way. in MySQL, VARCHAR is only a different method for storing characters.
MySQL implements this change because it saves space and makes table operations faster. Select a table type. The display size of TIMESTAMP must be an even number and be in the range of 2 ~ Within the range of 14. If you specify 0 display size or greater than 14, the size is forced to be 14. From 1 ~ The dimensions of odd values in the range of 13 are forced to be the next larger even number. You cannot store a text NULL in a TIMESTAMP column; setting it to NULL will be set to the current date and time. This is because the TIMESTAMP column is like this. The NULL and not null attributes are NOT used in general mode. If you specify them, they will be ignored. DESCRIBE tbl_name always reports that the TIMESTAMP column may be assigned a NULL value. MySQL maps a column type used by other sqldatabase vendors to MySQL type. If you want to know whether MySQL uses a column type other than the one you specified, issue a DESCRIBE tbl_name statement after creating or changing your table. If you use myisampack to compress a table, some other column types may change.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.