1
0
mirror of https://github.com/MariaDB/server.git synced 2025-06-01 19:42:01 +03:00

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).
This commit is contained in:
Sergei Golubchik 2018-03-19 23:06:59 +01:00
parent a15ab358fc
commit ccd5c9c64e

View File

@ -1225,6 +1225,8 @@ int main(int argc,char *argv[])
window_resize(0); window_resize(0);
#endif #endif
if (!status.batch)
{
put_info("Welcome to the MariaDB monitor. Commands end with ; or \\g.", put_info("Welcome to the MariaDB monitor. Commands end with ; or \\g.",
INFO_INFO); INFO_INFO);
my_snprintf((char*) glob_buffer.ptr(), glob_buffer.alloced_length(), my_snprintf((char*) glob_buffer.ptr(), glob_buffer.alloced_length(),
@ -1232,8 +1234,8 @@ int main(int argc,char *argv[])
mysql_get_server_name(&mysql), mysql_get_server_name(&mysql),
mysql_thread_id(&mysql), server_version_string(&mysql)); mysql_thread_id(&mysql), server_version_string(&mysql));
put_info((char*) glob_buffer.ptr(),INFO_INFO); put_info((char*) glob_buffer.ptr(),INFO_INFO);
put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"), INFO_INFO); put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"), INFO_INFO);
}
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
initialize_readline((char*) my_progname); initialize_readline((char*) my_progname);