From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org, Kirill Shcherbatov <kshcherbatov@tarantool.org> Cc: Vladimir Davydov <vdavydov.dev@gmail.com> Subject: Re: [tarantool-patches] Re: [PATCH v2 2/2] Fixed lost format on update and upsert operations. Date: Sun, 22 Apr 2018 18:15:38 +0300 [thread overview] Message-ID: <d142deb8-b182-3706-96c9-338d1fe2085b@tarantool.org> (raw) In-Reply-To: <18a8749f-ba4e-61a8-a58d-12257f2d0f32@tarantool.org> On 18/04/2018 15:55, Kirill Shcherbatov wrote: >> Why is tuple.transform so special? Why can't it derive the original >> tuple format, like tuple.update and tuple.upsert? > Transform should use runtime format. Vlad insisted on to do not redesign public API to contain format, just only in-line required code. Please, describe why we need inlined update here. 'Vlad insisted' is not a reason. > >> This doesn't check "transform integrity" AFAICS - the test passes even >> if we use the original tuple's format instead of runtime_tuple_format. > It's an integrity check to ensure that transform method hasn't degraded. Vova means, that if tuple:transform would use non-default tuple format, the tests will pass anyway. Please, add a test on transform, that would not pass, if tuple uses non-default format. > diff --git a/test/engine/update.test.lua b/test/engine/update.test.lua > index 0252b8a..3ff7e62 100644 > --- a/test/engine/update.test.lua > +++ b/test/engine/update.test.lua > @@ -94,3 +94,30 @@ space:select{} > space:update({2}, {}) > space:select{} > space:drop() > + > +-- > +-- gh-3051 Lost format while tuple update > +-- > +format = {} > +format[1] = {name = 'KEY', type = 'unsigned'} > +format[2] = {name = 'VAL', type = 'string'} > +s = box.schema.space.create('tst_sample', {engine = engine, format = format}) > +pk = s:create_index('pk') > +s:insert({1, 'sss', '3', '4', '5', '6', '7'}) > +aa = box.space.tst_sample:get(1) > +aa.VAL > +aa = aa:update({{'=',2,'ssss'}}) > +aa.VAL > +-- invalid update > +aa:update({{'=',2, 666}}) > +-- test transform integrity > +aa:transform(-1, 1) This test will pass even if we would use non-default tuple format.
next prev parent reply other threads:[~2018-04-22 15:15 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-04-06 16:24 [tarantool-patches] [PATCH v2 0/2] Fix lost format on update operation Kirill Shcherbatov 2018-04-06 16:24 ` [tarantool-patches] [PATCH v2 1/2] Fixed invalid check in lbox_tuple_transform Kirill Shcherbatov 2018-04-06 16:24 ` [tarantool-patches] [PATCH v2 2/2] Fixed lost format on update and upsert operations Kirill Shcherbatov 2018-04-08 13:56 ` [tarantool-patches] " Vladislav Shpilevoy 2018-04-10 10:23 ` Kirill Shcherbatov 2018-04-10 10:44 ` Vladislav Shpilevoy 2018-04-15 10:03 ` Kirill Shcherbatov 2018-04-15 13:18 ` Vladislav Shpilevoy 2018-04-16 7:47 ` Kirill Shcherbatov 2018-04-16 10:07 ` Vladislav Shpilevoy 2018-04-16 16:51 ` Kirill Shcherbatov 2018-04-16 17:14 ` Vladislav Shpilevoy 2018-04-18 12:28 ` Vladimir Davydov 2018-04-18 12:55 ` Kirill Shcherbatov 2018-04-22 15:15 ` Vladislav Shpilevoy [this message] 2018-04-28 6:56 ` Kirill Shcherbatov 2018-04-28 9:29 ` [tarantool-patches] Re: [PATCH v2 0/2] Fix lost format on update operation Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=d142deb8-b182-3706-96c9-338d1fe2085b@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=kshcherbatov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=vdavydov.dev@gmail.com \ --subject='Re: [tarantool-patches] Re: [PATCH v2 2/2] Fixed lost format on update and upsert operations.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox