MySQL: Syntax: Flag, keyword

Source: Internet
Author: User

The Character Sequence enclosed by backticks "'" is called a flag.

    • If the ansi_quotes mode is enabled, you can use the Character Sequence enclosed by double quotation marks "" to represent the flag.
    • The flag can contain any character,Of course, it is better to only use non-special characters such as [0-9a-za-z _ $,We recommend that you do not start with a number or dollar-this is the case for most systems.
    • In addition, if the token is a keyword (usually equal to a reserved word), it must be included.
    • The severe recommendation flag should not be "{m} e [N]", which may be confused with the scientific counting method!
    • The flag cannot contain ascii nul (0x00), \,/,., NUL, PRN, and other operating systems.

The maximum character length of a flag is 64.

Flag restrictions:

    • [Db_name.] [tb_name.] col_name -- MySQL Standard
    • [.] Tb_name -- limits compatible with ODBC

 

The case sensitivity of the flag: It depends on OS: windows is not distinguished, Linux is differentiated

    • Database, table, trigger, and alias depend on OS. But in the same statement, it must be exactly the same
    • Column, index, procedure, funcion, and envent are not differentiated.
    • Lower_case_table_names:
  • 0: differentiate the size. Save, search, and compare. The MyISAM storage engine may cause index usage problems on some small and insensitive OS.
  • 1: lower case. Save, search, and compare. -- Recommendation
  • 2: case-sensitive OS storage; search and compare in lower case. However, the table of the InnoDB Storage engine class has the same behavior as "1 ".

 

Parsing rules for function names: one sentence (good programming style: not the same as what the system already has !!!)

    • Generally, functions are divided into Native built-in, UDF, and stored functions.
    • Native functions have default parsing rules, but they are related to the configuration of the ignore_space server.
    • General rule: if a built-in function is followed by an express context, it is called as a function. Otherwise, it is considered as a flag and applies to most functions.
    • Special rule: Check whether the function name is followed by "(", used as a function call, or not as a flag. You can use SQL _functions () to view these functions.

Ignore_space:

    • Disabled: as long as it is a function listed in SQL _functions (), the above "Default rule" will be ignored, as long as it is followed by "(" is considered as a function call, it may cause non-expression environment errors
    • Enabled: (default) as long as it is a function listed in SQL _functions (), it must contain the function name as a flag.

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.