From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 2 Apr 2019 10:44:49 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH 04/13] sql: support big integers within sql binding Message-ID: <20190402074449.GD25072@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com, Stanislav Zudin List-ID: * Stanislav Zudin [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