Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v2 0/4] Don't truncate float in update
@ 2020-02-04 22:53 Vladislav Shpilevoy
  2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 1/4] tuple: don't truncate float in :update() Vladislav Shpilevoy
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Vladislav Shpilevoy @ 2020-02-04 22:53 UTC (permalink / raw)
  To: tarantool-patches, kostja.osipov, imun, korablev

The patchset fixes float value truncation in
tuple/space:update/upsert. First commit fixes the actual issue,
but introduces another bug that a float value can be stored into a
field having double type in its format.

The rest 3 commits fix this new bug.

However, there is an alternative how these 3 could be done. My
solution is that I calculate the result types in
xrow_update_*_store() functions. Because of that I don't know the
types during xrow_update_*_sizeof(), and it needs to return the
maximal possible size instead of exact size. The alternative is to
calculate types during sizeof. It would allow to return the exact
size. But it also would complicate the code. I can implement this
option if it looks better.

Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-4701-update-float-truncate
Issue: https://github.com/tarantool/tarantool/issues/4701

Changes in V2:
- Taken into account, that a field may have double type in its
  tuple format, and can't store floats at all.

Vladislav Shpilevoy (4):
  tuple: don't truncate float in :update()
  tuple: pass tuple format to xrow_update_*_store()
  tuple: allow xrow_update sizeof reserve more memory
  tuple: use field type in update of a float/double

 src/box/lua/tuple.c         |   2 +-
 src/box/memtx_space.c       |   7 ++-
 src/box/session_settings.c  |   2 +-
 src/box/space.c             |   6 +--
 src/box/tuple.c             |   4 +-
 src/box/vinyl.c             |   9 ++--
 src/box/vy_upsert.c         |   4 +-
 src/box/xrow_update.c       |  43 +++++++++------
 src/box/xrow_update.h       |  10 ++--
 src/box/xrow_update_array.c |  50 ++++++++++++-----
 src/box/xrow_update_bar.c   |  13 +++--
 src/box/xrow_update_field.c | 102 ++++++++++++++++++++++++-----------
 src/box/xrow_update_field.h |  22 +++++---
 src/box/xrow_update_map.c   |  34 ++++++++++--
 src/box/xrow_update_route.c |  13 +++--
 test/box/update.result      | 103 ++++++++++++++++++++++++++++++++++++
 test/box/update.test.lua    |  62 ++++++++++++++++++++++
 test/unit/column_mask.c     |   4 +-
 18 files changed, 388 insertions(+), 102 deletions(-)

-- 
2.21.1 (Apple Git-122.3)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-02-20 20:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 22:53 [Tarantool-patches] [PATCH v2 0/4] Don't truncate float in update Vladislav Shpilevoy
2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 1/4] tuple: don't truncate float in :update() Vladislav Shpilevoy
2020-02-10 14:41   ` Nikita Pettik
2020-02-10 21:18     ` Vladislav Shpilevoy
2020-02-19 21:36       ` Nikita Pettik
2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 2/4] tuple: pass tuple format to xrow_update_*_store() Vladislav Shpilevoy
2020-02-10 16:51   ` Nikita Pettik
2020-02-10 21:18     ` Vladislav Shpilevoy
2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 3/4] tuple: allow xrow_update sizeof reserve more memory Vladislav Shpilevoy
2020-02-10 16:05   ` Nikita Pettik
2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 4/4] tuple: use field type in update of a float/double Vladislav Shpilevoy
2020-02-10 16:16   ` Nikita Pettik
2020-02-10 21:18     ` Vladislav Shpilevoy
2020-02-05 11:09 ` [Tarantool-patches] [PATCH v2 0/4] Don't truncate float in update Konstantin Osipov
2020-02-05 22:11   ` Vladislav Shpilevoy
2020-02-20  6:15 ` Kirill Yukhin
2020-02-20 13:27   ` Nikita Pettik
2020-02-20 20:30   ` Vladislav Shpilevoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox