MySQL Code Primer Step I – Get MySQL Source Code
十一月 3, 2011 by sleebin9 · Leave a Comment
* Where Is MySQL Source Code
- Launchpad
https://launchpad.net/mysql
- MySQL Website
http://dev.mysql.com/downloads
Both Binaries and Source Code can be found there.
Launchpad is recommended, as its code is in a bazaar repository. A few fantastic benefits are there.
* Extra Informations In Source Repository
Many useful information is stored in bazaar repository. it can help us to understand the code well.
- Revision Log
Every commit creates a new revision and lots of information is logged. For each patch, we can find who committed it, when it was committed, which branch it merged from and what the commit message is.
- Commit Message
MySQL has a strict policy for commit messages. The message has to record related bug IDs or worklog IDs, give a clear description about the problem or the new feature and clarify how the problem is solved or the new feature is implemented.
- The Origin Of Each Line
Bazaar can show us the revision of each line in current work tree. It means the line was introduced in the revision. So it is very helpful for finding extra informations related to the code.
* Setup New Branches Easily
- Bazaar is a distributed VC tool. it is very easy to clone a new MySQL branch for ourself from launchpad, and develop your own code separately.
- The new branch keeps all information of the old version, so we can retrieve the code of old versions easily.
* MySQL Projects On Launchpad
- MySQL is more than just a database server. This Launchpad project acts as an umbrella for all projects related to (and including) the MySQL Server.
- Dozens Projects for MySQL are there. E.g. MySQL Connector, MySQL Proxy etc. The most important one is MySQL Server project. It implements MySQL server. So we mainly focus on MySQL Server code.
* Branches of MySQL Server
- 5.1
It is the branch of MySQL-5.1
- 5.5
It is the branch of MySQL-5.5.
- trunk
It is for unreleased new features.
- cluster-*
Cluster branches include the code of NDB Cluster.
* Clone New Branches From Launchpad
- Clone the code from launchpad repository
bzr branch lp:mysql-server/5.5
bzr branch lp:mysql-server/trunk
- Update your local branch if new patches are put in launchpad
bzr pull
bzr pull lp:mysql-server/5.5
Now, you have created mirrors of MySQL server code. You can write your own code and commit it to your branches.
Note: you could not use ‘bzr pull’ to update your branches if you have committed your own patches into the local branches. But you can do it by using ‘bzr merge’.
原创文章,转载请注明: 文章地址MySQL Code Primer Step I – Get MySQL Source Code
