mysqld.cc start Analysis and operation process (the problem is big, sorry)

Source: Internet
Author: User

MySQL source files compressed file mysql-5.7.12.tar.gz has 48.2Mb, so big guy.

Before learning C language and so on, think of a smelly C can do what ah, dare to see the source file I thoroughly shocked, just a THD class of instructions accounted for more than 3,000 lines,

Leave me in the wind messy, feeling the greatness of human software engineering, feeding the cat undergraduate is not or studying computer pinch.

directly to see the local class words must look dizzy, so the feeling is not from the main line to get better, from the driver main first, and then find out about the pressure after Mysql-5.7.12\sql mysql.cc,

Results for half a day, a ghost int main () did not see this:

int mysqld_main (int argc, char **argv)

I think that the driver or the entry program should not be int main (), and then go online to check the main () function is defined in \sql\main.cc.

Before myself to look at the source code, the result is too complex, and did not surf the internet to check information, make fool.

The source code for main.cc is simple, which is the process of calling Mysqld_main ():

   /* Main () for mysqld.  Calls Mysqld_main () entry point exported by SQL Library.  Here is the entry point to call Mysqld_main (), and finally put you to catch the */extern int mysqld_main (int argc, char **argv);//declares that this function exists elsewhere mysqld_main () int main ( int argc, char **argv) {  return Mysqld_main (argc, argv);//Call Mysqld_main ()}

When I sigh main.cc simple, mysqld.cc ruthless fan of my slap, is about 9300 lines, greasy brew Oh!

Header file Mysqld.h is about 980 lines, there are a lot of statements.

There are two mysqld_main () functions in mysqld.cc

Write to this had to stop, C Foundation is not good, want to see the next ifdef,ifndef or something.

mysqld.cc start Analysis and operation process (the problem is big, sorry)

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.