Replies: 4 comments 2 replies
-
All looks good so far. Except maybe rename |
Beta Was this translation helpful? Give feedback.
-
(I'm not familiar with tarantool's SQL code, so my questions are based only on the proposal above. Just because of curiosity.) On the first glance it seems logical to use
So I would ask to show all possible And, from my point of view, those frame/aggregate function/pointer are not values in the common understanding of this term. Should they actually be part of the |
Beta Was this translation helpful? Give feedback.
-
Looks good to me. |
Beta Was this translation helpful? Give feedback.
-
I general it all looks good to me, but here is (nob-blocking) question I would like to ask while we are in business of renaming types:
|
Beta Was this translation helpful? Give feedback.
-
I propose to refactor and rework
struct MEM
. What we have at the moment:Refactoring:
u32 uTemp
field, as it is not used anywhere.void * pFiller
field as it is not used anywhere.sql * db
field as it is not needed.i64 i;
withint64_t i;
(i64 == sql_int64 == long long int).struct Mem
tostruct mem
.Rework:
enum mem_type type
instead of setting type using flags (Replace MEM_* types by MP_* types and field_types #4906).enum field_type field_type
field (Remove enum field_type from struct Mem #5957).void (*xDel) (void *)
since we always use sql_free if MEM_Dyn is set.For STRING, VARBINARY, MAP and ARRAY values, I suggest creating a structure like this:
If we don't remove MEM_Term, i.e. we can have NULL-terminated STRING values, we can use n_zeroes to determine if there is '\0' at the end. However, in this case it will work differently than in the case of n_zeroes > 0 for VARBINARY: in the case of VARBINARY we have to add an extra '\0' at the end, but in the case of STRING we already have at least one '\0' at the end of the value .
For AGGREGATE mem, I suggest creating a structure like this:
In this case,
void *acc;
could be replaced with a union containing a pointers to all possible accumulation structures, but I don't think that's necessary.So, if we make all the suggested changes, the structure should look something like this:
Beta Was this translation helpful? Give feedback.
All reactions