Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
If no rpc_db was specified we shouldn't be overwriting the existing d…
…atabase

Summary: The code was always overwriting the THD's database with the database specified in the rpc_db connection attribute.  If this attribute wasn't set this would change the behavior.

Reviewed By: abal147

Differential Revision: D14313324

fbshipit-source-id: 6adec02
  • Loading branch information
jkedgar authored and facebook-github-bot committed Apr 23, 2019
1 parent 45df124 commit a55628c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/sql_parse_com_rpc.cc
Expand Up @@ -196,7 +196,8 @@ std::pair<bool, std::shared_ptr<Srv_session>> handle_com_rpc(THD *conn_thd)
}

// update db
if (srv_session->get_thd()->set_db(rpc_db.c_str(), rpc_db.size()))
if (rpc_db.size() > 0 &&
srv_session->get_thd()->set_db(rpc_db.c_str(), rpc_db.size()))
{
my_error(ER_RPC_FAILED_TO_SWITCH_DB, MYF(0), rpc_db.c_str());
goto error;
Expand Down

0 comments on commit a55628c

Please sign in to comment.