Skip to content

Commit 60d0a76

Browse files
committed
Fix
1 parent 5cac8f7 commit 60d0a76

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Client/BuzzHouse/Generator/StatementGenerator.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3893,19 +3893,20 @@ void StatementGenerator::updateGenerator(const SQLQuery & sq, ExternalIntegratio
38933893
{
38943894
const Rename & ren = query.rename();
38953895
const SQLObjectName & oobj = ren.old_object();
3896+
const SQLObjectName & nobj = ren.new_object();
38963897
const bool istable = oobj.has_est() && oobj.est().table().table()[0] == 't';
38973898
const bool isview = oobj.has_est() && oobj.est().table().table()[0] == 'v';
38983899
const bool isdictionary = oobj.has_est() && oobj.est().table().table()[0] == 'd';
38993900
const bool isdatabase = oobj.has_database();
39003901
const uint32_t old_tname
39013902
= static_cast<uint32_t>(std::stoul(isdatabase ? oobj.database().database().substr(1) : oobj.est().table().table().substr(1)));
3902-
const uint32_t new_tname = static_cast<uint32_t>(
3903-
std::stoul(isdatabase ? ren.new_object().database().database().substr(1) : ren.new_object().est().table().table().substr(1)));
3903+
const uint32_t new_tname
3904+
= static_cast<uint32_t>(std::stoul(isdatabase ? nobj.database().database().substr(1) : nobj.est().table().table().substr(1)));
39043905
std::optional<uint32_t> new_db;
39053906

3906-
if (!isdatabase && oobj.est().database().database() != "default")
3907+
if (!isdatabase && nobj.est().database().database() != "default")
39073908
{
3908-
new_db = static_cast<uint32_t>(std::stoul(oobj.est().database().database().substr(1)));
3909+
new_db = static_cast<uint32_t>(std::stoul(nobj.est().database().database().substr(1)));
39093910
}
39103911
if (istable)
39113912
{

0 commit comments

Comments
 (0)