Commit ccd5c9c6 authored by Sergei Golubchik's avatar Sergei Golubchik

mysql: don't prepare strings if they won't be used

in particular, don't call server_version_string() unnecessary,
because it runs 'SELECT @@version_comment' and this might block
under certain galera settings (wsrep_sync_wait).
parent a15ab358
......@@ -1225,15 +1225,17 @@ int main(int argc,char *argv[])
window_resize(0);
#endif
put_info("Welcome to the MariaDB monitor. Commands end with ; or \\g.",
INFO_INFO);
my_snprintf((char*) glob_buffer.ptr(), glob_buffer.alloced_length(),
"Your %s connection id is %lu\nServer version: %s\n",
mysql_get_server_name(&mysql),
mysql_thread_id(&mysql), server_version_string(&mysql));
put_info((char*) glob_buffer.ptr(),INFO_INFO);
put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"), INFO_INFO);
if (!status.batch)
{
put_info("Welcome to the MariaDB monitor. Commands end with ; or \\g.",
INFO_INFO);
my_snprintf((char*) glob_buffer.ptr(), glob_buffer.alloced_length(),
"Your %s connection id is %lu\nServer version: %s\n",
mysql_get_server_name(&mysql),
mysql_thread_id(&mysql), server_version_string(&mysql));
put_info((char*) glob_buffer.ptr(),INFO_INFO);
put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"), INFO_INFO);
}
#ifdef HAVE_READLINE
initialize_readline((char*) my_progname);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment