Commit 11408a69 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Fix Item tree changes/rollback debug print

parent 94da1cb4
......@@ -2234,6 +2234,9 @@ void THD::check_and_register_item_tree_change(Item **place, Item **new_value,
MEM_ROOT *runtime_memroot)
{
Item_change_record *change;
DBUG_ENTER("THD::check_and_register_item_tree_change");
DBUG_PRINT("enter", ("Register: %p (%p) <- %p (%p)",
*place, place, *new_value, new_value));
I_List_iterator<Item_change_record> it(change_list);
while ((change= it++))
{
......@@ -2243,6 +2246,7 @@ void THD::check_and_register_item_tree_change(Item **place, Item **new_value,
if (change)
nocheck_register_item_tree_change(place, change->old_value,
runtime_memroot);
DBUG_VOID_RETURN;
}
......@@ -2250,17 +2254,13 @@ void THD::rollback_item_tree_changes()
{
I_List_iterator<Item_change_record> it(change_list);
Item_change_record *change;
DBUG_ENTER("rollback_item_tree_changes");
while ((change= it++))
{
DBUG_PRINT("info", ("revert %p -> %p",
change->old_value, (*change->place)));
*change->place= change->old_value;
}
/* We can forget about changes memory: it's allocated in runtime memroot */
change_list.empty();
DBUG_VOID_RETURN;
}
......
......@@ -2725,10 +2725,14 @@ class THD :public Statement,
void change_item_tree(Item **place, Item *new_value)
{
DBUG_ENTER("THD::change_item_tree");
DBUG_PRINT("enter", ("Register: %p (%p) <- %p",
*place, place, new_value));
/* TODO: check for OOM condition here */
if (!stmt_arena->is_conventional())
nocheck_register_item_tree_change(place, *place, mem_root);
*place= new_value;
DBUG_VOID_RETURN;
}
/**
Make change in item tree after checking whether it needs registering
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment