[Tarantool-patches] [PATCH v2 4/4] tuple: use field type in update of a float/double
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Feb 11 00:18:50 MSK 2020
Thanks for the review!
The test was broken here. I fixed it and added a new test for
update operations, having a common prefix. To test that
xrow_update_route.c uses correct index base for JSON indexes.
================================================================================
diff --git a/test/box/update.result b/test/box/update.result
index 04866006a..65f14ea86 100644
--- a/test/box/update.result
+++ b/test/box/update.result
@@ -1736,9 +1736,10 @@ _ = s:delete{1}
---
...
-- Check deep fields.
-_ = s:create_index('deep_sk', {'field3', 'double', path = '[1].key1.key2[2]'})
+_ = s:create_index('deep_sk', { \
+ parts = {{'field3', 'double', path = '[1].key1.key2[2]'}} \
+})
---
-- error: Illegal parameters, unexpected option '1'
...
_ = s:replace{1, dbl1, {{key1 = {key2 = {1, dbl1}}}}}
---
@@ -1747,6 +1748,13 @@ s:update({1}, {{'+', 'field3[1].key1.key2[2]', dbl1}})
---
- [1, 1, [{'key1': {'key2': [1, 2]}}]]
...
+-- Check update operations with common prefix.
+s:update({1}, { \
+ {'=', 'field3[1].key1.key3', 100}, {'+', 'field3[1].key1.key2[2]', dbl1} \
+})
+---
+- [1, 1, [{'key1': {'key2': [1, 3], 'key3': 100}}]]
+...
s:drop()
---
...
diff --git a/test/box/update.test.lua b/test/box/update.test.lua
index d52be4f3b..d4a2f455c 100644
--- a/test/box/update.test.lua
+++ b/test/box/update.test.lua
@@ -654,8 +654,14 @@ _ = s:replace{1, dbl1, 1}
s:update({1}, {{'+', 2, dbl1}})
_ = s:delete{1}
-- Check deep fields.
-_ = s:create_index('deep_sk', {'field3', 'double', path = '[1].key1.key2[2]'})
+_ = s:create_index('deep_sk', { \
+ parts = {{'field3', 'double', path = '[1].key1.key2[2]'}} \
+})
_ = s:replace{1, dbl1, {{key1 = {key2 = {1, dbl1}}}}}
s:update({1}, {{'+', 'field3[1].key1.key2[2]', dbl1}})
+-- Check update operations with common prefix.
+s:update({1}, { \
+ {'=', 'field3[1].key1.key3', 100}, {'+', 'field3[1].key1.key2[2]', dbl1} \
+})
s:drop()
More information about the Tarantool-patches
mailing list