Hi! Thank you for review. My answer below.
I'm not sure what you describe is possible. But it is impossible
Diff:
diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index f8cf1af..79232de 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -351,19 +351,22 @@ mem_apply_type(struct Mem *record, enum field_type type)
return 0;
case FIELD_TYPE_SCALAR:
/* Can't cast MAP and ARRAY to scalar types. */
- if (record->subtype == SQL_SUBTYPE_MSGPACK) {
+ if ((record->flags & MEM_Blob) == MEM_Blob &&
Why do you need this additional check on MEM_Blob?Is it possible that memory holds raw msgpack and itstype not blob? If so, please provide an example.