summaryrefslogtreecommitdiff
path: root/storage/xtradb/lock
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-05-16 17:45:22 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-05-17 08:27:04 +0300
commit408ef65f840fac2150c385efb0c377ed9a2801d9 (patch)
tree6fa62f6f1e30cd28f96fc9d89b78192331aa07ad /storage/xtradb/lock
parent71cd205956818d29edb6bf09002ecf2fe8303f64 (diff)
downloadmariadb-git-408ef65f840fac2150c385efb0c377ed9a2801d9.tar.gz
Never pass NULL to innobase_get_stmt()
Diffstat (limited to 'storage/xtradb/lock')
-rw-r--r--storage/xtradb/lock/lock0lock.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc
index 717fbf02536..71612f66fcd 100644
--- a/storage/xtradb/lock/lock0lock.cc
+++ b/storage/xtradb/lock/lock0lock.cc
@@ -921,12 +921,18 @@ lock_reset_lock_and_trx_wait(
const char* stmt2=NULL;
size_t stmt_len;
trx_id_t trx_id = 0;
- stmt = innobase_get_stmt(lock->trx->mysql_thd, &stmt_len);
+ stmt = lock->trx->mysql_thd
+ ? innobase_get_stmt(lock->trx->mysql_thd, &stmt_len)
+ : NULL;
if (lock->trx->lock.wait_lock &&
lock->trx->lock.wait_lock->trx) {
trx_id = lock->trx->lock.wait_lock->trx->id;
- stmt2 = innobase_get_stmt(lock->trx->lock.wait_lock->trx->mysql_thd, &stmt_len);
+ stmt2 = lock->trx->lock.wait_lock->trx->mysql_thd
+ ? innobase_get_stmt(
+ lock->trx->lock.wait_lock
+ ->trx->mysql_thd, &stmt_len)
+ : NULL;
}
ib_logf(IB_LOG_LEVEL_INFO,
@@ -5636,13 +5642,11 @@ lock_rec_unlock(
trx_mutex_exit(trx);
stmt = innobase_get_stmt(trx->mysql_thd, &stmt_len);
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: Error: unlock row could not"
- " find a %lu mode lock on the record\n",
- (ulong) lock_mode);
- ut_print_timestamp(stderr);
- fprintf(stderr, " InnoDB: current statement: %.*s\n",
+
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "unlock row could not find a %u mode lock on the record;"
+ " statement=%.*s",
+ lock_mode,
(int) stmt_len, stmt);
return;