Skip to content

Commit 209a9e5

Browse files
drrtuymariadb-LeonidFedorov
authored andcommitted
chore(plugin): get rid of SELECT_LEX copy asignment calls.
1 parent a7e5115 commit 209a9e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dbcon/mysql/ha_mcs_impl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,15 +1348,14 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& c
13481348

13491349
// Save the item list
13501350
List<Item> items;
1351-
SELECT_LEX select_lex;
13521351

13531352
if (ha_mcs_common::isUpdateStatement(thd->lex->sql_command))
13541353
{
13551354
items = (thd->lex->first_select_lex()->item_list);
13561355
thd->lex->first_select_lex()->item_list = thd->lex->value_list;
13571356
}
13581357

1359-
select_lex = *lex->first_select_lex();
1358+
SELECT_LEX* select_lex = lex->first_select_lex();
13601359

13611360
//@Bug 2808 Error out on order by or limit clause
13621361
//@bug5096. support dml limit.
@@ -1412,7 +1411,7 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& c
14121411

14131412
gwi.clauseType = WHERE;
14141413

1415-
if (getSelectPlan(gwi, select_lex, updateCP, false, false, false, condStack) !=
1414+
if (getSelectPlan(gwi, *select_lex, updateCP, false, false, false, condStack) !=
14161415
0) //@Bug 3030 Modify the error message for unsupported functions
14171416
{
14181417
if (gwi.cs_vtable_is_update_with_derive)

dbcon/mysql/ha_view.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class View
5454
uint32_t processJoin(gp_walk_info& gwi, std::stack<execplan::ParseTree*>&);
5555

5656
private:
57-
SELECT_LEX fSelect;
57+
// Lifetime of fSelect is managed by MDB and must be longer than View object
58+
SELECT_LEX& fSelect;
5859
gp_walk_info* fParentGwip;
5960
execplan::CalpontSystemCatalog::TableAliasName fViewName;
6061
};

0 commit comments

Comments
 (0)