summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2009-03-06 11:49:39 +0100
committerKristofer Pettersson <kristofer.pettersson@sun.com>2009-03-06 11:49:39 +0100
commitd6634f461b9622c8bea9011a80528cfcb4ef32d3 (patch)
treea2136f93bb28c0e655cf133c9245ead5bf039ae9 /sql/sql_class.cc
parent76a5891429c62b3ec0fe3c74e8f3efb272433135 (diff)
parent52a07e9b745b5657e8fbd0c521291db8c26e66f2 (diff)
downloadmariadb-git-d6634f461b9622c8bea9011a80528cfcb4ef32d3.tar.gz
Manual merge
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index e00323ebab1..88b7dfb46d7 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -172,7 +172,9 @@ THD::THD()
/* statement id */ 0),
Open_tables_state(refresh_version),
lock_id(&main_lock_id),
- user_time(0), in_sub_stmt(0), global_read_lock(0), is_fatal_error(0),
+ user_time(0), in_sub_stmt(0),
+ table_map_for_update(0),
+ global_read_lock(0), is_fatal_error(0),
transaction_rollback_request(0), is_fatal_sub_stmt_error(0),
rand_used(0), time_zone_used(0),
last_insert_id_used(0), last_insert_id_used_bin_log(0), insert_id_used(0),
@@ -397,6 +399,10 @@ void THD::init_for_queries()
void THD::change_user(void)
{
+ pthread_mutex_lock(&LOCK_status);
+ add_to_status(&global_status_var, &status_var);
+ pthread_mutex_unlock(&LOCK_status);
+
cleanup();
cleanup_done= 0;
init();
@@ -653,6 +659,8 @@ void THD::cleanup_after_query()
free_items();
/* Reset where. */
where= THD::DEFAULT_WHERE;
+ /* reset table map for multi-table update */
+ table_map_for_update= 0;
}
@@ -1049,6 +1057,11 @@ bool select_send::send_data(List<Item> &items)
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
break;
}
+ /*
+ Reset buffer to its original state, as it may have been altered in
+ Item::send().
+ */
+ buffer.set(buff, sizeof(buff), &my_charset_bin);
}
thd->sent_row_count++;
if (!thd->vio_ok())