summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-12-14 15:50:01 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-12-14 15:50:01 +0200
commita2f2f686cbcb239420724fe9b1520089933e36fb (patch)
treea070d764d703e07cd967104745f63eeffb8f8fbb /sql/sql_class.cc
parentdbb39a778d43bb69c6dccbf6f6000010860d1850 (diff)
downloadmariadb-git-a2f2f686cbcb239420724fe9b1520089933e36fb.tar.gz
Work around the crash in MDEV-17814
Internal transactions may not have trx->mysql_thd. But at the same time, trx->duplicates should only hold if REPLACE or INSERT...ON DUPLICATE KEY UPDATE was executed from SQL. The flag feels misplaced. A more appropriate place for it would be row_prebuilt_t or similar.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 71d5b80eaa3..86eb6f28807 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2008, 2017, MariaDB Corporation.
+ Copyright (c) 2008, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -4525,7 +4525,8 @@ extern "C" int thd_rpl_is_parallel(const MYSQL_THD thd)
extern "C" int thd_rpl_stmt_based(const MYSQL_THD thd)
{
- return !thd->is_current_stmt_binlog_format_row() &&
+ return thd &&
+ !thd->is_current_stmt_binlog_format_row() &&
!thd->is_current_stmt_binlog_disabled();
}