MXS-1703 Better strtoll() & strtoull() error detection

The functions do not set errno on all invalid input, so it's best to check
endptr.

Also, strtoll is now used for server id scanning through QueryResult.
This commit is contained in:
Esa Korhonen
2018-04-11 17:58:43 +03:00
parent ca9682f042
commit 7f36339f53
4 changed files with 12 additions and 32 deletions

View File

@ -179,7 +179,11 @@ bool MariaDBServer::do_show_slave_status()
server_version != MYSQL_SERVER_VERSION_51)
{
/* Get Master_Server_Id */
master_server_id = scan_server_id(result->get_string(i_master_server_id).c_str());
auto parsed = result->get_uint(i_master_server_id);
if (parsed >= 0)
{
master_server_id = parsed;
}
}
if (server_version == MYSQL_SERVER_VERSION_100)