summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-05-05 17:05:24 +0300
committerunknown <monty@mysql.com>2004-05-05 17:05:24 +0300
commitcd21f7ce40ac4c7d415544a5b2aa07b1278419ac (patch)
tree3238bd16530e02dbfef96513749a73b7294880f8 /innobase
parent575541b9f755425eaeb07babfa07b6fd30f6d5d1 (diff)
parent7d918f213e64df4af4b00d0798fadf9ed1a872fb (diff)
downloadmariadb-git-cd21f7ce40ac4c7d415544a5b2aa07b1278419ac.tar.gz
Merge with 4.0.19
BitKeeper/etc/logging_ok: auto-union VC++Files/client/mysqlclient.dsp: Auto merged VC++Files/mysql.dsw: Auto merged extra/perror.c: Auto merged extra/replace.c: Auto merged innobase/configure.in: Auto merged innobase/include/lock0lock.h: Auto merged innobase/include/row0mysql.h: Auto merged innobase/include/sync0sync.h: Auto merged innobase/lock/lock0lock.c: Auto merged ltmain.sh: Auto merged BitKeeper/deleted/.del-libmysqld.def~8edf7b8780ce943c: Auto merged innobase/os/os0file.c: Auto merged innobase/pars/lexyy.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/srv/srv0start.c: Auto merged innobase/sync/sync0arr.c: Auto merged innobase/sync/sync0sync.c: Auto merged innobase/trx/trx0trx.c: Auto merged mysql-test/r/alias.result: Auto merged mysql-test/t/system_mysql_db_fix-master.opt: Auto merged mysql-test/r/func_time.result: Automatic merge mysql-test/r/innodb.result: Automatic merge mysql-test/t/alias.test: Automatic merge mysql-test/t/create.test: Automatic merge mysql-test/t/func_time.test: Automatic merge sql/ha_innodb.cc: Automatic merge sql/mysql_priv.h: Automatic merge mysql-test/r/rpl_multi_update.result: Automatic merge mysql-test/t/rpl_error_ignored_table.test: Automatic merge mysql-test/t/rpl_multi_update.test: Automatic merge sql/slave.h: Automatic merge sql/sql_base.cc: Automatic merge sql/sql_db.cc: Automatic merge sql/sql_insert.cc: Automatic merge sql/structs.h: Automatic merge sql/table.cc: Automatic merge strings/longlong2str-x86.s: Automatic merge strings/strings-x86.s: Automatic merge support-files/my-medium.cnf.sh: Automatic merge
Diffstat (limited to 'innobase')
-rw-r--r--innobase/include/lock0lock.h21
-rw-r--r--innobase/include/row0mysql.h16
-rw-r--r--innobase/include/sync0sync.h2
-rw-r--r--innobase/include/trx0trx.h2
-rw-r--r--innobase/lock/lock0lock.c130
-rw-r--r--innobase/os/os0file.c55
-rw-r--r--innobase/pars/lexyy.c3
-rw-r--r--innobase/row/row0mysql.c88
-rw-r--r--innobase/srv/srv0srv.c5
-rw-r--r--innobase/srv/srv0start.c1
-rw-r--r--innobase/sync/sync0arr.c1
-rw-r--r--innobase/sync/sync0sync.c6
-rw-r--r--innobase/trx/trx0trx.c2
13 files changed, 305 insertions, 27 deletions
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index 9ccea5ad7a4..b1f9a10ee05 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -381,7 +381,9 @@ lock_table(
/* out: DB_SUCCESS, DB_LOCK_WAIT,
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
- does nothing */
+ does nothing;
+ if LOCK_TABLE_EXP bits are set,
+ creates an explicit table lock */
dict_table_t* table, /* in: database table in dictionary cache */
ulint mode, /* in: lock mode */
que_thr_t* thr); /* in: query thread */
@@ -394,6 +396,14 @@ lock_is_on_table(
/* out: TRUE if there are lock(s) */
dict_table_t* table); /* in: database table in dictionary cache */
/*************************************************************************
+Releases a table lock.
+Releases possible other transactions waiting for this lock. */
+
+void
+lock_table_unlock(
+/*==============*/
+ lock_t* lock); /* in: lock */
+/*************************************************************************
Releases an auto-inc lock a transaction possibly has on a table.
Releases possible other transactions waiting for this lock. */
@@ -410,6 +420,14 @@ lock_release_off_kernel(
/*====================*/
trx_t* trx); /* in: transaction */
/*************************************************************************
+Releases table locks, and releases possible other transactions waiting
+because of these locks. */
+
+void
+lock_release_tables_off_kernel(
+/*===========================*/
+ trx_t* trx); /* in: transaction */
+/*************************************************************************
Cancels a waiting lock request and releases possible other transactions
waiting behind it. */
@@ -536,6 +554,7 @@ extern lock_sys_t* lock_sys;
/* Lock types */
#define LOCK_TABLE 16 /* these type values should be so high that */
#define LOCK_REC 32 /* they can be ORed to the lock mode */
+#define LOCK_TABLE_EXP 80 /* explicit table lock */
#define LOCK_TYPE_MASK 0xF0UL /* mask used to extract lock type from the
type_mode field in a lock */
/* Waiting lock flag */
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 0fb2994a414..0b9f34dda1e 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -161,6 +161,22 @@ row_lock_table_autoinc_for_mysql(
row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
table handle */
/*************************************************************************
+Unlocks a table lock possibly reserved by trx. */
+
+void
+row_unlock_table_for_mysql(
+/*=======================*/
+ trx_t* trx); /* in: transaction */
+/*************************************************************************
+Sets a table lock on the table mentioned in prebuilt. */
+
+int
+row_lock_table_for_mysql(
+/*=====================*/
+ /* out: error code or DB_SUCCESS */
+ row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
+ table handle */
+/*************************************************************************
Does an insert for MySQL. */
int
diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h
index 332c08fd38a..0cc48d5f299 100644
--- a/innobase/include/sync0sync.h
+++ b/innobase/include/sync0sync.h
@@ -218,7 +218,7 @@ void
mutex_get_debug_info(
/*=================*/
mutex_t* mutex, /* in: mutex */
- char** file_name, /* out: file where requested */
+ const char** file_name, /* out: file where requested */
ulint* line, /* out: line where requested */
os_thread_id_t* thread_id); /* out: id of the thread which owns
the mutex */
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index bb2d7e8f64d..71269cb1e4e 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -421,6 +421,8 @@ struct trx_struct{
lock_t* auto_inc_lock; /* possible auto-inc lock reserved by
the transaction; note that it is also
in the lock list trx_locks */
+ ulint n_tables_locked;/* number of table locks reserved by
+ the transaction, stored in trx_locks */
UT_LIST_NODE_T(trx_t)
trx_list; /* list of transactions */
UT_LIST_NODE_T(trx_t)
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index f12389cb6b2..8805a22bb57 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -2001,7 +2001,11 @@ lock_grant(
release it at the end of the SQL statement */
lock->trx->auto_inc_lock = lock;
- }
+ } else if (lock_get_type(lock) == LOCK_TABLE_EXP) {
+ ut_ad(lock_get_mode(lock) == LOCK_S
+ || lock_get_mode(lock) == LOCK_X);
+ lock->trx->n_tables_locked++;
+ }
#ifdef UNIV_DEBUG
if (lock_print_waits) {
@@ -2939,7 +2943,7 @@ retry:
}
if (ret == LOCK_VICTIM_IS_START) {
- if (lock_get_type(lock) == LOCK_TABLE) {
+ if (lock_get_type(lock) & LOCK_TABLE) {
table = lock->un_member.tab_lock.table;
index = NULL;
} else {
@@ -3015,7 +3019,7 @@ lock_deadlock_recursive(
/* Look at the locks ahead of wait_lock in the lock queue */
for (;;) {
- if (lock_get_type(lock) == LOCK_TABLE) {
+ if (lock_get_type(lock) & LOCK_TABLE) {
lock = UT_LIST_GET_PREV(un_member.tab_lock.locks, lock);
} else {
@@ -3347,7 +3351,9 @@ lock_table(
/* out: DB_SUCCESS, DB_LOCK_WAIT,
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
- does nothing */
+ does nothing;
+ if LOCK_TABLE_EXP bits are set,
+ creates an explicit table lock */
dict_table_t* table, /* in: database table in dictionary cache */
ulint mode, /* in: lock mode */
que_thr_t* thr) /* in: query thread */
@@ -3362,6 +3368,8 @@ lock_table(
return(DB_SUCCESS);
}
+ ut_ad(flags == 0 || flags == LOCK_TABLE_EXP);
+
trx = thr_get_trx(thr);
lock_mutex_enter_kernel();
@@ -3390,7 +3398,12 @@ lock_table(
return(err);
}
- lock_table_create(table, mode, trx);
+ lock_table_create(table, mode | flags, trx);
+
+ if (flags) {
+ ut_ad(mode == LOCK_S || mode == LOCK_X);
+ trx->n_tables_locked++;
+ }
lock_mutex_exit_kernel();
@@ -3471,7 +3484,8 @@ lock_table_dequeue(
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
- ut_ad(lock_get_type(in_lock) == LOCK_TABLE);
+ ut_ad(lock_get_type(in_lock) == LOCK_TABLE ||
+ lock_get_type(in_lock) == LOCK_TABLE_EXP);
lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, in_lock);
@@ -3496,6 +3510,22 @@ lock_table_dequeue(
/*=========================== LOCK RELEASE ==============================*/
/*************************************************************************
+Releases a table lock.
+Releases possible other transactions waiting for this lock. */
+
+void
+lock_table_unlock(
+/*==============*/
+ lock_t* lock) /* in: lock */
+{
+ mutex_enter(&kernel_mutex);
+
+ lock_table_dequeue(lock);
+
+ mutex_exit(&kernel_mutex);
+}
+
+/*************************************************************************
Releases an auto-inc lock a transaction possibly has on a table.
Releases possible other transactions waiting for this lock. */
@@ -3542,7 +3572,7 @@ lock_release_off_kernel(
lock_rec_dequeue_from_page(lock);
} else {
- ut_ad(lock_get_type(lock) == LOCK_TABLE);
+ ut_ad(lock_get_type(lock) & LOCK_TABLE);
if (lock_get_mode(lock) != LOCK_IS
&& 0 != ut_dulint_cmp(trx->undo_no,
@@ -3559,6 +3589,11 @@ lock_release_off_kernel(
}
lock_table_dequeue(lock);
+ if (lock_get_type(lock) == LOCK_TABLE_EXP) {
+ ut_ad(lock_get_mode(lock) == LOCK_S
+ || lock_get_mode(lock) == LOCK_X);
+ trx->n_tables_locked--;
+ }
}
if (count == LOCK_RELEASE_KERNEL_INTERVAL) {
@@ -3578,6 +3613,73 @@ lock_release_off_kernel(
mem_heap_empty(trx->lock_heap);
ut_a(trx->auto_inc_lock == NULL);
+ ut_a(trx->n_tables_locked == 0);
+}
+
+/*************************************************************************
+Releases table locks, and releases possible other transactions waiting
+because of these locks. */
+
+void
+lock_release_tables_off_kernel(
+/*===========================*/
+ trx_t* trx) /* in: transaction */
+{
+ dict_table_t* table;
+ ulint count;
+ lock_t* lock;
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
+
+ lock = UT_LIST_GET_LAST(trx->trx_locks);
+
+ count = 0;
+
+ while (lock != NULL) {
+
+ count++;
+
+ if (lock_get_type(lock) == LOCK_TABLE_EXP) {
+ ut_ad(lock_get_mode(lock) == LOCK_S
+ || lock_get_mode(lock) == LOCK_X);
+ if (trx->insert_undo || trx->update_undo) {
+
+ /* The trx may have modified the table.
+ We block the use of the MySQL query
+ cache for all currently active
+ transactions. */
+
+ table = lock->un_member.tab_lock.table;
+
+ table->query_cache_inv_trx_id =
+ trx_sys->max_trx_id;
+ }
+
+ lock_table_dequeue(lock);
+ trx->n_tables_locked--;
+ lock = UT_LIST_GET_LAST(trx->trx_locks);
+ continue;
+ }
+
+ if (count == LOCK_RELEASE_KERNEL_INTERVAL) {
+ /* Release the kernel mutex for a while, so that we
+ do not monopolize it */
+
+ lock_mutex_exit_kernel();
+
+ lock_mutex_enter_kernel();
+
+ count = 0;
+ }
+
+ lock = UT_LIST_GET_PREV(trx_locks, lock);
+ }
+
+ mem_heap_empty(trx->lock_heap);
+
+ ut_a(trx->n_tables_locked == 0);
}
/*************************************************************************
@@ -3597,7 +3699,7 @@ lock_cancel_waiting_and_release(
lock_rec_dequeue_from_page(lock);
} else {
- ut_ad(lock_get_type(lock) == LOCK_TABLE);
+ ut_ad(lock_get_type(lock) & LOCK_TABLE);
lock_table_dequeue(lock);
}
@@ -3638,7 +3740,7 @@ lock_reset_all_on_table_for_trx(
ut_a(!lock_get_wait(lock));
lock_rec_discard(lock);
- } else if (lock_get_type(lock) == LOCK_TABLE
+ } else if (lock_get_type(lock) & LOCK_TABLE
&& lock->un_member.tab_lock.table == table) {
ut_a(!lock_get_wait(lock));
@@ -3690,8 +3792,12 @@ lock_table_print(
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
- ut_a(lock_get_type(lock) == LOCK_TABLE);
+ ut_a(lock_get_type(lock) == LOCK_TABLE ||
+ lock_get_type(lock) == LOCK_TABLE_EXP);
+ if (lock_get_type(lock) == LOCK_TABLE_EXP) {
+ fputs("EXPLICIT ", file);
+ }
fputs("TABLE LOCK table ", file);
ut_print_name(file, lock->un_member.tab_lock.table->name);
fprintf(file, " trx id %lu %lu",
@@ -4012,7 +4118,7 @@ loop:
lock_rec_print(file, lock);
} else {
- ut_ad(lock_get_type(lock) == LOCK_TABLE);
+ ut_ad(lock_get_type(lock) & LOCK_TABLE);
lock_table_print(file, lock);
}
@@ -4293,7 +4399,7 @@ lock_validate(void)
lock = UT_LIST_GET_FIRST(trx->trx_locks);
while (lock) {
- if (lock_get_type(lock) == LOCK_TABLE) {
+ if (lock_get_type(lock) & LOCK_TABLE) {
lock_table_queue_validate(
lock->un_member.tab_lock.table);
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 92e7f1e4fc3..ff5b30bec0d 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -312,7 +312,7 @@ os_file_handle_error(
/* out: TRUE if we should retry the
operation */
os_file_t file, /* in: file pointer */
- char* name, /* in: name of a file or NULL */
+ const char* name, /* in: name of a file or NULL */
const char* operation)/* in: operation */
{
ulint err;
@@ -369,6 +369,32 @@ os_file_handle_error(
return(FALSE);
}
+#if !defined(__WIN__) && !defined(UNIV_HOTBACKUP)
+/********************************************************************
+Obtain an exclusive lock on a file. */
+static
+int
+os_file_lock(
+/*=========*/
+ /* out: 0 on success */
+ int fd, /* in: file descriptor */
+ const char* name) /* in: file name */
+{
+ struct flock lk;
+ lk.l_type = F_WRLCK;
+ lk.l_whence = SEEK_SET;
+ lk.l_start = lk.l_len = 0;
+ if (fcntl(fd, F_SETLK, &lk) == -1) {
+ fprintf(stderr,
+ "InnoDB: Unable to lock %s", name);
+ perror (": fcntl");
+ close(fd);
+ return(-1);
+ }
+ return 0;
+}
+#endif /* !defined(__WIN__) && !defined(UNIV_HOTBACKUP) */
+
/********************************************************************
Does error handling when a file operation fails. */
static
@@ -781,7 +807,7 @@ try_again:
}
return(file);
-#else
+#else /* __WIN__ */
os_file_t file;
int create_flag;
ibool retry;
@@ -826,12 +852,17 @@ try_again:
if (retry) {
goto try_again;
}
+#ifndef UNIV_HOTBACKUP
+ } else if (os_file_lock(file, name)) {
+ *success = FALSE;
+ file = -1;
+#endif
} else {
*success = TRUE;
}
return(file);
-#endif
+#endif /* __WIN__ */
}
/********************************************************************
@@ -902,7 +933,7 @@ os_file_create_simple_no_error_handling(
}
return(file);
-#else
+#else /* __WIN__ */
os_file_t file;
int create_flag;
@@ -930,12 +961,17 @@ os_file_create_simple_no_error_handling(
if (file == -1) {
*success = FALSE;
+#ifndef UNIV_HOTBACKUP
+ } else if (os_file_lock(file, name)) {
+ *success = FALSE;
+ file = -1;
+#endif
} else {
*success = TRUE;
}
return(file);
-#endif
+#endif /* __WIN__ */
}
/********************************************************************
@@ -1056,7 +1092,7 @@ try_again:
}
return(file);
-#else
+#else /* __WIN__ */
os_file_t file;
int create_flag;
ibool retry;
@@ -1136,12 +1172,17 @@ try_again:
if (retry) {
goto try_again;
}
+#ifndef UNIV_HOTBACKUP
+ } else if (os_file_lock(file, name)) {
+ *success = FALSE;
+ file = -1;
+#endif
} else {
*success = TRUE;
}
return(file);
-#endif
+#endif /* __WIN__ */
}
/***************************************************************************
diff --git a/innobase/pars/lexyy.c b/innobase/pars/lexyy.c
index 638571ada97..1b8c69ccc7a 100644
--- a/innobase/pars/lexyy.c
+++ b/innobase/pars/lexyy.c
@@ -4,6 +4,9 @@
* $Header: /home/heikki/cvsroot/ib/pars/lexyy.c,v 1.2 2003/10/30 20:27:19 heikki Exp $
*/
+/* This include MUST be first to keep things portable ! */
+#include "univ.i"
+
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 4da27bca1a9..5432add37f7 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -711,10 +711,94 @@ run_again:
/* It may be that the current session has not yet started
its transaction, or it has been committed: */
-
+
+ trx_start_if_not_started(trx);
+
+ err = lock_table(0, prebuilt->table, prebuilt->select_lock_type, thr);
+
+ trx->error_state = err;
+
+ if (err != DB_SUCCESS) {
+ que_thr_stop_for_mysql(thr);
+
+ was_lock_wait = row_mysql_handle_errors(&err, trx, thr, NULL);
+
+ if (was_lock_wait) {
+ goto run_again;
+ }
+
+ trx->op_info = (char *) "";
+
+ return(err);
+ }
+
+ que_thr_stop_for_mysql_no_error(thr, trx);
+
+ trx->op_info = (char *) "";
+
+ return((int) err);
+}
+
+/*************************************************************************
+Unlocks a table lock possibly reserved by trx. */
+
+void
+row_unlock_table_for_mysql(
+/*=======================*/
+ trx_t* trx) /* in: transaction */
+{
+ if (!trx->n_tables_locked) {
+
+ return;
+ }
+
+ mutex_enter(&kernel_mutex);
+ lock_release_tables_off_kernel(trx);
+ mutex_exit(&kernel_mutex);
+}
+/*************************************************************************
+Sets a table lock on the table mentioned in prebuilt. */
+
+int
+row_lock_table_for_mysql(
+/*=====================*/
+ /* out: error code or DB_SUCCESS */
+ row_prebuilt_t* prebuilt) /* in: prebuilt struct in the MySQL
+ table handle */
+{
+ trx_t* trx = prebuilt->trx;
+ que_thr_t* thr;
+ ulint err;
+ ibool was_lock_wait;
+
+ ut_ad(trx);
+ ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
+
+ trx->op_info = (char *) "setting table lock";
+
+ if (prebuilt->sel_graph == NULL) {
+ /* Build a dummy select query graph */
+ row_prebuild_sel_graph(prebuilt);
+ }
+
+ /* We use the select query graph as the dummy graph needed
+ in the lock module call */
+
+ thr = que_fork_get_first_thr(prebuilt->sel_graph);
+
+ que_thr_move_to_run_state_for_mysql(thr, trx);
+
+run_again:
+ thr->run_node = thr;
+ thr->prev_node = thr->common.parent;
+
+ /* It may be that the current session has not yet started
+ its transaction, or it has been committed: */
+
trx_start_if_not_started(trx);
- err = lock_table(0, prebuilt->table, LOCK_AUTO_INC, thr);
+ err = lock_table(LOCK_TABLE_EXP, prebuilt->table,
+ prebuilt->select_lock_type, thr);
trx->error_state = err;
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 73bbd145517..9dffdbf2f9f 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1655,6 +1655,11 @@ loop:
mutex_enter(&srv_monitor_file_mutex);
rewind(srv_monitor_file);
srv_printf_innodb_monitor(srv_monitor_file);
+#ifdef __WIN__
+ chsize(fileno(srv_monitor_file), ftell(srv_monitor_file));
+#else /* __WIN__ */
+ ftruncate(fileno(srv_monitor_file), ftell(srv_monitor_file));
+#endif /* __WIN__ */
mutex_exit(&srv_monitor_file_mutex);
if (srv_print_innodb_tablespace_monitor
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 33d84cfaa8e..68fcb82c6d8 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1112,6 +1112,7 @@ NetWare. */
}
mutex_create(&srv_monitor_file_mutex);
+ mutex_set_level(&srv_monitor_file_mutex, SYNC_NO_ORDER_CHECK);
srv_monitor_file_name = mem_alloc(
strlen(fil_path_to_mysql_datadir) +
20 + sizeof "/innodb_status.");
diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c
index 1268b22e2f8..426d7ff9f92 100644
--- a/innobase/sync/sync0arr.c
+++ b/innobase/sync/sync0arr.c
@@ -618,7 +618,6 @@ sync_array_detect_deadlock(
rw_lock_t* lock;
os_thread_id_t thread;
ibool ret;
- rw_lock_t* lock;
rw_lock_debug_t*debug;
ut_a(arr && start && cell);
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index e711acbf84e..c1fb31bc966 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -531,7 +531,7 @@ void
mutex_get_debug_info(
/*=================*/
mutex_t* mutex, /* in: mutex */
- char** file_name, /* out: file where requested */
+ const char** file_name, /* out: file where requested */
ulint* line, /* out: line where requested */
os_thread_id_t* thread_id) /* out: id of the thread which owns
the mutex */
@@ -590,7 +590,7 @@ mutex_list_print_info(void)
/*=======================*/
{
mutex_t* mutex;
- char* file_name;
+ const char* file_name;
ulint line;
os_thread_id_t thread_id;
ulint count = 0;
@@ -788,7 +788,7 @@ sync_thread_levels_g(
if (mutex_get_lock_word(mutex) != 0) {
#ifdef UNIV_SYNC_DEBUG
- char* file_name;
+ const char* file_name;
ulint line;
os_thread_id_t thread_id;
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index a69b9a96824..fc0a67278d2 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -151,6 +151,7 @@ trx_create(
trx->n_tickets_to_enter_innodb = 0;
trx->auto_inc_lock = NULL;
+ trx->n_tables_locked = 0;
trx->read_view_heap = mem_heap_create(256);
trx->read_view = NULL;
@@ -278,6 +279,7 @@ trx_free(
ut_a(!trx->has_search_latch);
ut_a(!trx->auto_inc_lock);
+ ut_a(!trx->n_tables_locked);
ut_a(trx->dict_operation_lock_mode == 0);