From fa43a962a8b19b4bd851055c6793663b705dec2a Mon Sep 17 00:00:00 2001 From: David Hall Date: Wed, 4 Apr 2018 15:56:53 -0500 Subject: [PATCH] MCOL-1325 rename table fails when database different than current database --- dbcon/mysql/ha_calpont_ddl.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dbcon/mysql/ha_calpont_ddl.cpp b/dbcon/mysql/ha_calpont_ddl.cpp index 68f963825..611f1da3b 100755 --- a/dbcon/mysql/ha_calpont_ddl.cpp +++ b/dbcon/mysql/ha_calpont_ddl.cpp @@ -2074,16 +2074,14 @@ int ha_calpont_impl_rename_table_(const char* from, const char* to, cal_connecti stmt = stmt1.str(); string db; - if ( thd->db ) - db = thd->db; - else if ( fromPair.first.length() !=0 ) + if ( fromPair.first.length() !=0 ) db = fromPair.first; - else - db = toPair.first; + else if ( thd->db ) + db = thd->db; int rc = ProcessDDLStatement(stmt, db, "", tid2sid(thd->thread_id), emsg); if (rc != 0) - push_warning(thd, Sql_condition::WARN_LEVEL_ERROR, 9999, emsg.c_str()); + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 9999, emsg.c_str()); return rc; }