You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-4282 Enable Select Handler for Prepared Statements
This patch enables select handler for executing prepared statements. Most importantly, we are now activating a persistent arena which will allocate any new items in a permanent MEMROOT for prepared statements and stored procedures. Refer to JOIN::optimize_inner() for details. In processWhere(), we now use SELECT_LEX::prep_where in case we are executing a prepared statement, as this is where the saved WHERE clause is stored for prepared statement processing. In addition, we also disable derived handler for prepared statements.
This commit is contained in:
@ -6369,8 +6369,13 @@ int processWhere(SELECT_LEX &select_lex,
|
||||
Item_cond* icp = 0;
|
||||
bool isUpdateDelete = false;
|
||||
|
||||
if (join != 0)
|
||||
// Flag to indicate if this is a prepared statement
|
||||
bool isPS = gwi.thd->stmt_arena && gwi.thd->stmt_arena->is_stmt_execute();
|
||||
|
||||
if (join != 0 && !isPS)
|
||||
icp = reinterpret_cast<Item_cond*>(join->conds);
|
||||
else if (isPS && select_lex.prep_where)
|
||||
icp = (Item_cond*)(select_lex.prep_where);
|
||||
|
||||
// if icp is null, try to find the where clause other where
|
||||
if (!join && gwi.thd->lex->derived_tables)
|
||||
|
Reference in New Issue
Block a user