summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2009-10-22 23:30:28 +0100
committerLuis Soares <luis.soares@sun.com>2009-10-22 23:30:28 +0100
commitf1bb8c3c55bf68057db9a8a452f3426a8fe7d975 (patch)
treecda093e6fa6bf30a99c47f39b90880ac8b4a7e2c /sql/sql_class.cc
parent75116feb4b8976df3078f288f31fec7f46462461 (diff)
parent6ae50d8aedbded8dcdc7504d116f25bcd02535ff (diff)
downloadmariadb-git-f1bb8c3c55bf68057db9a8a452f3426a8fe7d975.tar.gz
manual merge: mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge
Conflicts ========= Text conflict in .bzr-mysql/default.conf Text conflict in libmysqld/CMakeLists.txt Text conflict in libmysqld/Makefile.am Text conflict in mysql-test/collections/default.experimental Text conflict in mysql-test/extra/rpl_tests/rpl_row_sp006.test Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result Text conflict in mysql-test/suite/rpl/r/rpl_loaddata.result Text conflict in mysql-test/suite/rpl/r/rpl_loaddata_fatal.result Text conflict in mysql-test/suite/rpl/r/rpl_row_create_table.result Text conflict in mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result Text conflict in mysql-test/suite/rpl/r/rpl_stm_log.result Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result Text conflict in mysql-test/t/mysqlbinlog.test Text conflict in sql/CMakeLists.txt Text conflict in sql/Makefile.am Text conflict in sql/log_event_old.cc Text conflict in sql/rpl_rli.cc Text conflict in sql/slave.cc Text conflict in sql/sql_binlog.cc Text conflict in sql/sql_lex.h 21 conflicts encountered. NOTE ==== mysql-5.1-rpl-merge has been made a mirror of mysql-next-mr: - "mysql-5.1-rpl-merge$ bzr pull ../mysql-next-mr" This is the first cset (merge/...) committed after pulling from mysql-next-mr.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc39
1 files changed, 36 insertions, 3 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 4ed25b03ed7..757f6abb00b 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -266,6 +266,42 @@ const char *set_thd_proc_info(THD *thd, const char *info,
}
extern "C"
+const char* thd_enter_cond(MYSQL_THD thd, pthread_cond_t *cond,
+ pthread_mutex_t *mutex, const char *msg)
+{
+ if (!thd)
+ thd= current_thd;
+
+ const char* old_msg = thd->proc_info;
+ safe_mutex_assert_owner(mutex);
+ thd->mysys_var->current_mutex = mutex;
+ thd->mysys_var->current_cond = cond;
+ thd->proc_info = msg;
+ return old_msg;
+}
+
+extern "C"
+void thd_exit_cond(MYSQL_THD thd, const char *old_msg)
+{
+ if (!thd)
+ thd= current_thd;
+
+ /*
+ Putting the mutex unlock in thd_exit_cond() ensures that
+ mysys_var->current_mutex is always unlocked _before_ mysys_var->mutex is
+ locked (if that would not be the case, you'll get a deadlock if someone
+ does a THD::awake() on you).
+ */
+ pthread_mutex_unlock(thd->mysys_var->current_mutex);
+ pthread_mutex_lock(&thd->mysys_var->mutex);
+ thd->mysys_var->current_mutex = 0;
+ thd->mysys_var->current_cond = 0;
+ thd->proc_info = old_msg;
+ pthread_mutex_unlock(&thd->mysys_var->mutex);
+ return;
+}
+
+extern "C"
void **thd_ha_data(const THD *thd, const struct handlerton *hton)
{
return (void **) &thd->ha_data[hton->slot].ha_ptr;
@@ -475,9 +511,6 @@ THD::THD()
limit_found_rows= 0;
row_count_func= -1;
statement_id_counter= 0UL;
-#ifdef ERROR_INJECT_SUPPORT
- error_inject_value= 0UL;
-#endif
// Must be reset to handle error with THD's created for init of mysqld
lex->current_select= 0;
start_time=(time_t) 0;