Skip to content

Commit 596cb9a

Browse files
committed
utils: polish tarantool version checks
* Fixed the incorrect JSON path indexes check (it was introduced in 2.1.2). * Properly commented all checks. * Correctly handle `tarantool-3*`, `tarantool-4*` and so on. * Normalized as DNF for readability. It follows changes I made in PR #227 for merger checks.
1 parent fbe4de0 commit 596cb9a

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

crud/common/utils.lua

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,39 @@ local function determine_enabled_features()
201201
local minor = tonumber(major_minor_patch_parts[2])
202202
local patch = tonumber(major_minor_patch_parts[3])
203203

204-
-- since Tarantool 2.3
205-
enabled_tarantool_features.fieldpaths = major >= 2 and (minor > 3 or minor == 3 and patch >= 1)
204+
-- Named fields and JSON path fields in the update operation
205+
-- were implemented in 2.3.1, see [1]. Key changes are [2],
206+
-- [3] and [4].
207+
--
208+
-- [1]: https://github.com/tarantool/tarantool/issues/1261
209+
-- [2]: https://github.com/tarantool/tarantool/commit/9ee5cf82ae579d62543a4bb335dd1e99b00dacf6
210+
-- [3]: https://github.com/tarantool/tarantool/commit/940133ae8c33addb37c4d1db9559585587ea08cd
211+
-- [4]: https://github.com/tarantool/tarantool/commit/6e97d6a986a446a23c84e5e4777585132607cbb6
212+
enabled_tarantool_features.fieldpaths =
213+
(major == 2 and minor == 3 and patch >= 1) or
214+
(major == 2 and minor >= 4) or
215+
(major >= 3)
206216

207-
-- since Tarantool 2.4
208-
enabled_tarantool_features.uuids = major >= 2 and (minor > 4 or minor == 4 and patch >= 1)
217+
-- UUID storing and indexing was added in 2.4.1, see [1] and
218+
-- [2].
219+
--
220+
-- [1]: https://github.com/tarantool/tarantool/issues/2916
221+
-- [2]: https://github.com/tarantool/tarantool/issues/4268
222+
enabled_tarantool_features.uuids =
223+
(major == 2 and minor == 4 and patch >= 1) or
224+
(major == 2 and minor >= 5) or
225+
(major >= 3)
209226

210-
-- since Tarantool 2.6.3 / 2.7.2 / 2.8.1
211-
enabled_tarantool_features.jsonpath_indexes = major >= 3 or (major >= 2 and ((minor >= 6 and patch >= 3)
212-
or (minor >= 7 and patch >= 2) or (minor >= 8 and patch >= 1) or minor >= 9))
227+
-- Indexes using a JSON path were introduced in 2.1.2, see
228+
-- [1]. Key changes are [2] and [3].
229+
--
230+
-- [1]: https://github.com/tarantool/tarantool/issues/1012
231+
-- [2]: https://github.com/tarantool/tarantool/commit/4273ec52e122d6d37c8deedf1bc10732a7e40c0e
232+
-- [3]: https://github.com/tarantool/tarantool/commit/a754980d7feab110b8c82ee15ef13e080afa2882
233+
enabled_tarantool_features.jsonpath_indexes =
234+
(major == 2 and minor == 1 and patch >= 2) or
235+
(major == 2 and minor >= 2) or
236+
(major >= 3)
213237

214238
-- The merger module was implemented in 2.2.1, see [1].
215239
-- However it had the critical problem [2], which leads to

test/integration/select_test.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ end
13051305
pgroup.test_jsonpath_index_field = function(g)
13061306
t.skip_if(
13071307
not crud_utils.tarantool_supports_jsonpath_indexes(),
1308-
"Jsonpath indexes supported since 2.6.3/2.7.2/2.8.1"
1308+
"JSON path indexes are supported since 2.1.2"
13091309
)
13101310

13111311
helpers.insert_objects(g, 'cars', {
@@ -1392,7 +1392,7 @@ end
13921392
pgroup.test_jsonpath_index_field_pagination = function(g)
13931393
t.skip_if(
13941394
not crud_utils.tarantool_supports_jsonpath_indexes(),
1395-
"Jsonpath indexes supported since 2.6.3/2.7.2/2.8.1"
1395+
"JSON path indexes are supported since 2.1.2"
13961396
)
13971397

13981398
local cars = helpers.insert_objects(g, 'cars', {

test/unit/select_filters_test.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ end
857857
g.test_jsonpath_indexes = function()
858858
t.skip_if(
859859
not crud_utils.tarantool_supports_jsonpath_indexes(),
860-
"Jsonpath indexes supported since 2.6.3/2.7.2/2.8.1"
860+
"JSON path indexes are supported since 2.1.2"
861861
)
862862

863863
local conditions = {

0 commit comments

Comments
 (0)