muduo icon indicating copy to clipboard operation
muduo copied to clipboard

Add contrib/mariadbclient

Open hfcrwx opened this issue 4 years ago • 2 comments

MariaDB Async Client Using Non-blocking API

Reference: https://mariadb.com/kb/en/using-the-non-blocking-library/ https://github.com/MariaDB/server/blob/5.5/client/async_example.c https://github.com/MariaDB/server/blob/5.5/tests/async_queries.c https://mariadb.com/kb/en/non-blocking-api-reference/

Build: centos7-x86_64: yum install mariadb-devel mariadb-libs ubuntu14.04-x86_64: apt-get install libmariadbclient-dev ln -sf libmariadbclient.so libmysqlclient.so

hfcrwx avatar May 29 '20 13:05 hfcrwx

Please fix travis-ci first, put apt-get install in .travis.yml.

chenshuo avatar May 29 '20 19:05 chenshuo

Update:

  1. zero copy MYSQL_RES: mysql_use_result, mysql_fetch_row_* -> mysql_store_result_* use new callback function: std::function<void(MariaDBClient*, MYSQL_RES*)>

  2. change MariaDBClient to a single-threaded version (as Hiredis, Curl)

  3. refactors

Test successfully with MariaDB-Server/MySQL-Server

ref: https://mariadb.com/kb/en/non-blocking-api-reference/ https://dev.mysql.com/doc/refman/5.7/en/mysql-store-result.html

hfcrwx avatar Jun 25 '20 18:06 hfcrwx