From 52723ec09a03859e4e77f7a7465e809e18aa2edf Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Mon, 28 Oct 2024 18:48:55 +0700 Subject: [PATCH] MDEV-34880 Incorrect result for query with derived table having TEXT field Fixup: check key flags only in the case of successful index initialization --- sql/handler.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index cf639884637..38e0ea4fbf7 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3749,11 +3749,11 @@ int handler::ha_index_init(uint idx, bool sorted) inited= INDEX; active_index= idx; end_range= NULL; + /* + Do not allow reads from UNIQUE HASH indexes. + */ + DBUG_ASSERT(!(table->key_info[active_index].flags & HA_UNIQUE_HASH)); } - /* - Do not allow reads from UNIQUE HASH indexes. - */ - DBUG_ASSERT(!(table->key_info[active_index].flags & HA_UNIQUE_HASH)); DBUG_RETURN(result); }