Writing a MySQL storage engine from scratch (2016)
codeproject.com
Writing a MySQL storage engine from scratch (2016)
1–10 of 26 posts
Re: Writing a MySQL storage engine from scratch (2016)
#2I have some memories of looking at VB6 code on codeproject.com over a decade ago, interesting to see that the site is still around and useful.
Re: Writing a MySQL storage engine from scratch (2016)
#3Re: Writing a MySQL storage engine from scratch (2016)
#4This is obstinately documented (http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOC...), but I can't find a nice cheat-sheet saying "to send a query, you send this packet and you receive these packets" etc. I've taken to looking at e.g. the pure-Python PyMySQL package source-code https://github.com/PyMySQL/PyMySQL/blob/master/pymysql/conne...
Here's my progress so far: https://gist.github.com/williame/ebf003dd85d5949f551a72331ae...
Anyone know what commands you can send, and what the expected responses are?
Re: Writing a MySQL storage engine from scratch (2016)
#5Oh, and it becomes painfully obvious why MySQL cannot use more than one index while executing the query.
(Sorry for being pedantic)
Re: Writing a MySQL storage engine from scratch (2016)
#6Somewhat related, I recently started trying to reverse-engineer the MySQL wire protocol. My idea is that if this is better documented then it will be easier for people to make databases that interoperate with MySQL clients but aren't MySQL that much easier (personally I want a custom Shard-Query-ish thing). This is obstinately documented ( http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOC... ), but I can't…
http://imysql.com/mysql-internal-manual/client-server-protoc...
http://imysql.com/mysql-internal-manual/connection-phase.htm...
http://imysql.com/mysql-internal-manual/com-query.html
etc
Re: Writing a MySQL storage engine from scratch (2016)
#7Somewhat related, I recently started trying to reverse-engineer the MySQL wire protocol. My idea is that if this is better documented then it will be easier for people to make databases that interoperate with MySQL clients but aren't MySQL that much easier (personally I want a custom Shard-Query-ish thing). This is obstinately documented ( http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOC... ), but I can't…
Take a closer look at the MySQL documentation. You dont have to reverse engineer anything - it's all there and documented (source: wrote a client impl based on the docs) http://imysql.com/mysql-internal-manual/client-server-protoc... http://imysql.com/mysql-internal-manual/connection-phase.htm... http://imysql.com/mysql-internal-manual/com-query.html etc
There's a lot of dead links, e.g. http://imysql.com/mysql-internal-manual/com-query.html doesn't describe the response? Got any idea what a query response consists of?
Re: Writing a MySQL storage engine from scratch (2016)
#8Somewhat related, I recently started trying to reverse-engineer the MySQL wire protocol. My idea is that if this is better documented then it will be easier for people to make databases that interoperate with MySQL clients but aren't MySQL that much easier (personally I want a custom Shard-Query-ish thing). This is obstinately documented ( http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOC... ), but I can't…
It does all the work of figuring out what's a request/response and parsing / dumping out various parts of the protocol.
Re: Writing a MySQL storage engine from scratch (2016)
#9Re: Writing a MySQL storage engine from scratch (2016)
#10Oh, and it becomes painfully obvious why MySQL cannot use more than one index while executing the query.