From b963cbaf4bcfe2c510c38edeacc2d6b1cae2d7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 3 Aug 2018 11:49:49 +0300 Subject: [PATCH] Follow-up fix to MDEV-16865: InnoDB fts_query() ignores KILL fts_query(): Remove a redundant condition (result will never be NULL), and instead check if *result is NULL, to prevent SIGSEGV in fts_query_free_result(). --- storage/innobase/fts/fts0que.cc | 2 +- storage/xtradb/fts/fts0que.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc index 7d4cd7a3646..78521df75d9 100644 --- a/storage/innobase/fts/fts0que.cc +++ b/storage/innobase/fts/fts0que.cc @@ -4019,7 +4019,7 @@ fts_query( if (trx_is_interrupted(trx)) { error = DB_INTERRUPTED; ut_free(lc_query_str); - if (result != NULL) { + if (*result) { fts_query_free_result(*result); } goto func_exit; diff --git a/storage/xtradb/fts/fts0que.cc b/storage/xtradb/fts/fts0que.cc index 50f198401f9..9966656e772 100644 --- a/storage/xtradb/fts/fts0que.cc +++ b/storage/xtradb/fts/fts0que.cc @@ -4038,7 +4038,7 @@ fts_query( if (trx_is_interrupted(trx)) { error = DB_INTERRUPTED; ut_free(lc_query_str); - if (result != NULL) { + if (*result) { fts_query_free_result(*result); } goto func_exit;