Skip to content
Snippets Groups Projects
Commit 17d1c6f1 authored by Nikita Pettik's avatar Nikita Pettik Committed by Kirill Yukhin
Browse files

sql: fix value of mask to map VDBE memory type

Accidentally, mask which is used to map type of VDBE memory cell into
outer API types was replaced with MEM_TypeMask. But value of the latter
is larger then possible values of VDBE memory cells types. Hence, if it
is applied to memory cell, not only pure types is taken into
consideration, but some additional flags (such as MEM_Zero) as well.
Overall, it results in wrong type calculation for zeroed blobs, for
instance. Lets return back previous mask.

Follow-up #3698
Needed for #3544
parent 4095e305
No related branches found
No related tags found
No related merge requests found
......@@ -253,6 +253,15 @@ struct Mem {
#define MEM_Zero 0x0000
#endif
/**
* In contrast to Mem_TypeMask, this one allows to get
* pure type of memory cell, i.e. without _Dyn/_Zero and other
* auxiliary flags.
*/
enum {
MEM_PURE_TYPE_MASK = 0x1f
};
/* Return TRUE if Mem X contains dynamically allocated content - anything
* that needs to be deallocated to avoid a leak.
......
......@@ -280,7 +280,7 @@ sql_value_type(sql_value * pVal)
SQL_INTEGER, /* 0x1e */
SQL_NULL, /* 0x1f */
};
return aType[pVal->flags & MEM_TypeMask];
return aType[pVal->flags & MEM_PURE_TYPE_MASK];
}
/* Make a copy of an sql_value object
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment