RDB/MySQL

mysql select 시 내부 소스코드 call flow

세모데 2020. 6. 16. 15:43

기본적인 소스 내부 call구조는 mysql과 mariadb가 비슷하여 아래와 같은 형태로 진행이 됨.

 

mysql

 

mariadb 

    - mysqld_main    : main function

         - handle_connections_sockets  :   무한 loop 형태로 client 연결을 받아서 socket 처리

               - handle_accepted_socket :  통신 listener로써 신규 연결에 대해 thread 생성    

                    - create_new_thread :  신규 연결에 대한 thread 생성

                          - do_handle_one_connection 

                                - do_command   

                                        - fetch_command

                                        - dispatch_command : sql 구문을 파싱 및 분석