From ac02d985374866491a8b020be0dfb9bb60062b6f Mon Sep 17 00:00:00 2001
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Date: Tue, 8 Oct 2019 11:57:10 +0300
Subject: [PATCH] box: fix func_index invalid return error message

Functional index extractor code used to raise an invalid
error message when the user-defined extractor function
returns a scalar instead of a table.

Closes #4553

(cherry picked from commit 260a3b3ab530177a652c5eea283e1910472f2f04)
---
 src/box/key_list.c            | 2 +-
 test/engine/func_index.result | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/box/key_list.c b/src/box/key_list.c
index e130d1c8c2..3d736b55f2 100644
--- a/src/box/key_list.c
+++ b/src/box/key_list.c
@@ -144,7 +144,7 @@ key_list_iterator_next(struct key_list_iterator *it, const char **value)
 		diag_set(ClientError, ER_FUNC_INDEX_FORMAT, it->index_def->name,
 			 space ? space_name(space) : "",
 			 tt_sprintf("supplied key type is invalid: expected %s",
-				    field_type_strs[MP_ARRAY]));
+				    field_type_strs[FIELD_TYPE_ARRAY]));
 		return -1;
 	}
 	struct key_def *key_def = it->index_def->key_def;
diff --git a/test/engine/func_index.result b/test/engine/func_index.result
index 877b76d5ea..2d7da01470 100644
--- a/test/engine/func_index.result
+++ b/test/engine/func_index.result
@@ -148,7 +148,7 @@ idx = s:create_index('idx', {func = box.func.invalidreturn0.id, parts = {{1, 'un
 s:insert({1})
  | ---
  | - error: 'Key format doesn''t match one defined in functional index ''idx'' of space
- |     ''withdata'': supplied key type is invalid: expected boolean'
+ |     ''withdata'': supplied key type is invalid: expected array'
  | ...
 idx:drop()
  | ---
-- 
GitLab