Both MySQL TiDB and PostgreSQL support connecting via socket on Unix-like systems. This is even their default behavior when not specifying using TCP/IP as it’s more secure and modern.
However, MySQL and PostgreSQL has different socket format. Namely, mysql.sock vs .s.PGSQL.nnnnwhere nnnn is the server’s port number.
Currently we have TiDB’s old method of generating mysql.sock file, we would like to replace it with one that comply with Postgres’ standard.
Which Module does this belong
Server module. This should be handled before/ along with handshake
Task List
[x] Implement Postgres socket generation upon server start
[x] Modify connection method so it can handle connection via socket
[x] Add Unit Tests for connecting via socket in server/tidb_test.go
Development Task
Description
Both MySQL TiDB and PostgreSQL support connecting via socket on Unix-like systems. This is even their default behavior when not specifying using TCP/IP as it’s more secure and modern. However, MySQL and PostgreSQL has different socket format. Namely, mysql.sock vs
.s.PGSQL.nnnn
wherennnn
is the server’s port number.Currently we have TiDB’s old method of generating
mysql.sock
file, we would like to replace it with one that comply with Postgres’ standard.Which Module does this belong
Server module. This should be handled before/ along with handshake
Task List
References
https://dev.mysql.com/doc/refman/8.0/en/connection-options.html#option_general_socket https://www.postgresql.org/docs/9.3/runtime-config-connection.html