[tarantool-patches] Re: [PATCH 01/13] sql: Convert big integers from string

Konstantin Osipov kostja at tarantool.org
Tue Apr 2 10:27:09 MSK 2019


* n.pettik <korablev at tarantool.org> [19/03/25 18:13]:
> I suggest to make all atoi return -1 in case of errors (including overflow),
> and 0 in case of successful conversion. Error itself you can set via diag_set().
> Sign of the result you can pass via output param.
> This way would be more Tarantool-like.

I agree.

> Moreover, instead of storing UINT in INT, I suggest to use fair enum and
> output param is_uint/is_negative/is_whatever/…

Perhaps return MP_INT/MP_UINT? 

> It’s not fair to return OVERFLOW result in case of “invalid format”.
> See my comment concerning return values above.

I agree, usign diag_set and distinct errors is a) ANSI req b)
user-friendly
 

-- 
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