summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@sanjaLaptopT>2017-12-20 13:52:27 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2017-12-27 16:01:37 +0100
commit462808f3b65b60958eaf8013b80857e341cc9f6c (patch)
tree24af784d839c132fb74c3cd99d46d6fd86ce8161 /sql/sql_class.cc
parent924db8b4ed3f268cbe91a1734611f4dc2311c7be (diff)
downloadmariadb-git-462808f3b65b60958eaf8013b80857e341cc9f6c.tar.gz
MDEV-10657: incorrect result returned with binary protocol (prepared statements)
If translation table present when we materialize the derived table then change it to point to the materialized table. Added debug info to see really what happens with what derived.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 00d860e7887..b007729494e 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -2192,6 +2192,8 @@ void THD::nocheck_register_item_tree_change(Item **place, Item *old_value,
MEM_ROOT *runtime_memroot)
{
Item_change_record *change;
+ DBUG_ENTER("THD::nocheck_register_item_tree_change");
+ DBUG_PRINT("enter", ("Register %p <- %p", old_value, (*place)));
/*
Now we use one node per change, which adds some memory overhead,
but still is rather fast as we use alloc_root for allocations.
@@ -2204,12 +2206,13 @@ void THD::nocheck_register_item_tree_change(Item **place, Item *old_value,
OOM, thd->fatal_error() is called by the error handler of the
memroot. Just return.
*/
- return;
+ DBUG_VOID_RETURN;
}
change= new (change_mem) Item_change_record;
change->place= place;
change->old_value= old_value;
change_list.append(change);
+ DBUG_VOID_RETURN;
}
/**
@@ -2250,7 +2253,11 @@ void THD::rollback_item_tree_changes()
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;