google / mysql-ripple

Ripple, a server that can serve as a middleman in MySQL replication
Apache License 2.0
373 stars 46 forks source link

mysql_server_connection.cc:112:48: error: too many arguments to function 'my_bool my_net_init(NET*, Vio*, unsigned int)' #16

Open lynch0227 opened 5 years ago

lynch0227 commented 5 years ago

when buiding the package, I meet the errors. Env: 14.04.1-Ubuntu OPENSSL 1.1.1 libmariadbclient-dev

Error Message: src/main/tools/process-tools.cc:118: sigaction(32, &sa, nullptr) failed src/main/tools/process-tools.cc:118: sigaction(33, &sa, nullptr) failed mysql_server_connection.cc: In static member function 'static mysql_ripple::mysql::ServerConnection mysql_ripple::mysql::ServerConnection::Accept(Vio)': mysql_server_connection.cc:112:48: warning: converting to non-pointer type 'unsigned int' from NULL [-Wconversion-null] if (my_net_init(&mysql->net, vio, NULL, flags)) { ^ mysql_server_connection.cc:112:48: error: too many arguments to function 'my_bool my_net_init(NET, Vio, unsigned int)' In file included from external/external_libs/mysql/mysql.h:73:0, from mysql_server_connection.cc:24: external/external_libs/mysql/mysql_com.h:535:9: note: declared here my_bool my_net_init(NET net, Vio vio, unsigned int my_flags); ^ src/main/tools/linux-sandbox-pid1.cc:437: waitpid returned 2 src/main/tools/linux-sandbox-pid1.cc:457: child exited with code 1 src/main/tools/linux-sandbox.cc:204: child exited normally with exitcode 1

How can I fix it? Thank you.

pivanof commented 5 years ago

This error means that the version of libmariadbclient-dev you have is older than what I have on Debian machine. I'll need to put some compilation guards to make this compile with different versions in the future or just pull the sources of the library from MariaDB's github repo. But for now you should remove "NULL" from that line, i.e. make it look like this: if (my_net_init(&mysql->net, vio, flags)) {