diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-14 15:50:01 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-14 15:50:01 +0200 |
commit | a2f2f686cbcb239420724fe9b1520089933e36fb (patch) | |
tree | a070d764d703e07cd967104745f63eeffb8f8fbb /sql/sql_class.cc | |
parent | dbb39a778d43bb69c6dccbf6f6000010860d1850 (diff) | |
download | mariadb-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.cc | 5 |
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(); } |