Post

MySQL SQL执行流程

SQL执行流程

do_command Read one command from connection and execute it (query or simple command). This function is called in loop from thread function.

1
2
3
4
5
6
> my_net_read
> dispatch_command: Perform one connection-level (COM_XXXX) command.
    > mysql_parse
        > parse_sql: Parse a query.
        > mysql_rewrite_query: Rewrite a query.
        > mysql_execute_command: Execute command saved in thd and lex->sql_command.