MySQL /*! Code ...... */Usage _ MySQL

Source: Internet
Author: User
When running a script file, you often see the following information :! 40101SET @ OLD_CHARACTER_SET_CLIENT @ CHARACTER_SET_CLIENT ;! 40101SET @ OLD_CHARACTER_SET_RESULTS @ CHARACTER_SET_RESULTS ;! 40101SET @ OL:
/! 40101 SET @ OLD_CHARACTER_SET_CLIENT = @ CHARACTER_SET_CLIENT /;
/! 40101 SET @ OLD_CHARACTER_SET_RESULTS = @ CHARACTER_SET_RESULTS /;
/! 40101 SET @ OLD_COLLATION_CONNECTION = @ COLLATION_CONNECTION /;
/! 40101 set names UTF8 /;
/! 40103 SET @ OLD_TIME_ZONE = @ TIME_ZONE /;

Obtain /! Code ...... /Is explained as follows:

The MySQL server contains some extensions not available in other SQL DBMS. Note: If they are used, the code cannot be transplanted to other SQL servers. In some cases, you can write the code that contains MySQL extensions, but still keep it portable by using "/… /"Comment out these extensions. In this example, the MySQL server can parse and execute the code in the comment, just like other MySQL statements, but other SQL servers will ignore these extensions. For example:

SELECT /! STRAIGHT_JOIN/col_name FROM table1, table2 WHERE...
If the character "!" The version number is added. the syntax in the comment is executed only when the MySQL version is equal to or higher than the specified version number:

CREATE /! 32302 TEMPORARY/TABLE t (a INT );
This means that if your version number is 3.23.02 or higher, the MySQL server will use the TEMPORARY keyword.

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.