summaryrefslogtreecommitdiff
path: root/sql/sql_cursor.cc
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@sun.com>2010-01-12 12:32:55 +0100
committerTor Didriksen <tor.didriksen@sun.com>2010-01-12 12:32:55 +0100
commitbe634ee66e0f6c5d69a174d9a59fa5228211b347 (patch)
tree1fbb840c3793ca42c8dc384865cbd5e81ec1e904 /sql/sql_cursor.cc
parent1405f019e75567573ff6c5f4cd6a5f270a561866 (diff)
downloadmariadb-git-be634ee66e0f6c5d69a174d9a59fa5228211b347.tar.gz
Backport of
Bug#45523 "Objects of class base_ilist should not be copyable". Suppress the compiler-generated public copy constructor and assignment operator of class base_ilist; instead, implement move_elements_to() function which transfers ownership of elements from one list to another.
Diffstat (limited to 'sql/sql_cursor.cc')
-rw-r--r--sql/sql_cursor.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 098f049704c..31aa3e7ea52 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -321,7 +321,7 @@ Sensitive_cursor::post_open(THD *thd)
lock= thd->lock;
query_id= thd->query_id;
free_list= thd->free_list;
- change_list= thd->change_list;
+ thd->change_list.move_elements_to(&change_list);
reset_thd(thd);
/* Now we have an active cursor and can cause a deadlock */
thd->lock_info.n_cursors++;
@@ -437,7 +437,7 @@ Sensitive_cursor::fetch(ulong num_rows)
thd->open_tables= open_tables;
thd->lock= lock;
thd->query_id= query_id;
- thd->change_list= change_list;
+ change_list.move_elements_to(&thd->change_list);
/* save references to memory allocated during fetch */
thd->set_n_backup_active_arena(this, &backup_arena);
@@ -459,7 +459,7 @@ Sensitive_cursor::fetch(ulong num_rows)
/* Grab free_list here to correctly free it in close */
thd->restore_active_arena(this, &backup_arena);
- change_list= thd->change_list;
+ thd->change_list.move_elements_to(&change_list);
reset_thd(thd);
for (info= ht_info; info->read_view; info++)
@@ -506,7 +506,7 @@ Sensitive_cursor::close()
info->ht= 0;
}
- thd->change_list= change_list;
+ change_list.move_elements_to(&thd->change_list);
{
/*
XXX: Another hack: we need to set THD state as if in a fetch to be
@@ -532,7 +532,6 @@ Sensitive_cursor::close()
join= 0;
stmt_arena= 0;
free_items();
- change_list.empty();
DBUG_VOID_RETURN;
}