Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org
Cc: "v.shpilevoy@tarantool.org" <v.shpilevoy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v2 2/2] Fixed lost format on update and upsert operations.
Date: Mon, 16 Apr 2018 19:51:46 +0300	[thread overview]
Message-ID: <0f5103aa-cbd6-8ccb-326d-51875e0f561d@tarantool.org> (raw)
In-Reply-To: <f7d3d235-dbd1-983b-f64d-ab688c49e122@tarantool.org>

From 84f2fc22124c2a2d1450de9b818f61c9c1cf31b0 Mon Sep 17 00:00:00 2001
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Date: Mon, 16 Apr 2018 19:50:04 +0300
Subject: [PATCH] New tests for invalid update and upsert

---
 test/engine/update.result   | 10 ++++++++++
 test/engine/update.test.lua |  5 ++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/test/engine/update.result b/test/engine/update.result
index 48398d2..0ae22ac 100644
--- a/test/engine/update.result
+++ b/test/engine/update.result
@@ -719,6 +719,11 @@ aa.VAL
 ---
 - ssss
 ...
+-- invalid update
+aa:update({{'=',2, 666}})
+---
+- error: 'Tuple field 2 type does not match one required by operation: expected string'
+...
 -- test transform integrity
 aa:transform(-1, 1)
 ---
@@ -741,6 +746,11 @@ box.space.tst_sample:get(2).VAL
 ---
 - wwwww2
 ...
+-- invalid upsert
+s:upsert({2, 666}, {{'=', 2, 666}})
+---
+- error: 'Tuple field 2 type does not match one required by operation: expected string'
+...
 s:drop()
 ---
 ...
diff --git a/test/engine/update.test.lua b/test/engine/update.test.lua
index c53e458..3ff7e62 100644
--- a/test/engine/update.test.lua
+++ b/test/engine/update.test.lua
@@ -108,6 +108,8 @@ 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)
 aa = nil
@@ -116,5 +118,6 @@ s:upsert({2, 'wwwww'}, {{'=', 2, 'wwwww'}})
 box.space.tst_sample:get(2).VAL
 s:upsert({2, 'wwwww2'}, {{'=', 2, 'wwwww2'}})
 box.space.tst_sample:get(2).VAL
-
+-- invalid upsert
+s:upsert({2, 666}, {{'=', 2, 666}})
 s:drop()
-- 
2.7.4


On 16.04.2018 13:07, Vladislav Shpilevoy wrote:
> Hello. Thanks for fixes. One more thing is left - please,
> add tests on incorrect update and incorrect upsert, as I
> asked you in two previous reviews.
> 
> And in tests you does not need to do insert + get. Insert returns
> the tuple, so you can do t = s:insert(), t:update/upsert ...
> 
> On 16/04/2018 10:47, Kirill Shcherbatov wrote:
>> I've fixed tests and wrong code style with tabs.
>>
>>  From f9803f8d0b411abac02e35d5e4120ff0ce7e9341 Mon Sep 17 00:00:00 2001
>> From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
>> Date: Mon, 16 Apr 2018 10:44:10 +0300
>> Subject: [PATCH] Fixed tests and spaces
>>
> 

  reply	other threads:[~2018-04-16 16:51 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 [this message]
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
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=0f5103aa-cbd6-8ccb-326d-51875e0f561d@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[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