[tarantool-patches] [PATCH 04/13] sql: support big integers within sql binding
Konstantin Osipov
kostja at tarantool.org
Tue Apr 2 10:44:49 MSK 2019
* Stanislav Zudin <szudin at tarantool.org> [19/03/15 22:09]:
> @@ -260,6 +256,16 @@ sql_column_to_messagepack(struct sql_stmt *stmt, int i,
> mp_encode_int(pos, n);
> break;
> }
> + case SQL_UNSIGNED: {
> + assert(sql_column_is_unsigned(stmt, i));
> + int64_t n = sql_column_int64(stmt, i);
> + size = mp_sizeof_uint(n);
> + char *pos = (char *) region_alloc(region, size);
> + if (pos == NULL)
> + goto oom;
> + mp_encode_uint(pos, n);
> + break;
> + }
Tarantool does have unsigned *field type*, which in future will be
available in SQL as well. I think (ab) using SQL_UNSIGNED type
code which in future will be used for this data type in SQL (or
hopefully we will ditch SQL_* type enum and will use enum
field_type instead in entire SQL) creates a confusion.
Unsigned range is a property of SQL_INTEGER *data type*, not a data
type in itself.
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list