[tarantool-patches] Re: [PATCH 3/9] sql: use msgpack types instead of custom ones
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Mon Apr 22 21:02:21 MSK 2019
Thanks for the fixes!
>>> @@ -139,15 +139,15 @@ lengthFunc(sql_context * context, int argc, sql_value ** argv)
>>>
>>> assert(argc == 1);
>>> UNUSED_PARAMETER(argc);
>>> - switch (sql_value_type(argv[0])) {
>>> - case SQL_BLOB:
>>> - case SQL_INTEGER:
>>> - case SQL_FLOAT:{
>>> + switch (sql_value_mp_type(argv[0])) {
>>> + case MP_BIN:
>>> + case MP_INT:
>>> + case MP_DOUBLE:{
>>
>> 4. Probably you could fix part of this:
>> https://github.com/tarantool/tarantool/issues/4159 in scope of
>> this commit, alongside.
>
> THis patch provides straightforward refactoring, I don’t want
> to involve here non-trivial changes.
Yes, you are right, it is not worth doing here.
> diff --git a/src/box/sql/date.c b/src/box/sql/date.c
> index 5f5272ea3..1c7a5ad2d 100644
> --- a/src/box/sql/date.c
> +++ b/src/box/sql/date.c
> @@ -932,12 +932,12 @@ isDate(sql_context * context, int argc, sql_value ** argv, DateTime * p)
> {
> int i, n;
> const unsigned char *z;
> - int eType;
> + enum mp_type eType;
> memset(p, 0, sizeof(*p));
> if (argc == 0) {
> return setDateTimeToCurrent(context, p);
> }
> - if ((eType = sql_value_type(argv[0])) == SQL_FLOAT
> + if ((eType = sql_value_type(argv[0])) == MP_DOUBLE
> || eType == SQL_INTEGER) {
SQL_INTEGER is removed already. Please, replace with MP_INT.
More information about the Tarantool-patches
mailing list