Skip to content

Commit adf8df5

Browse files
authored
Fix updating intermediate nullable fields for <= 2.2 Tarantool version (#134)
Updating intermediate nullable fields failed for Tarantool version < 2.3. The problem was in error checking. In Tarantool version < 2.3 there are `box.error.NO_SUCH_FIELD_NO` and `box.error.NO_SUCH_FIELD_NAME` errors for not finding field in the tuple but in Tarantool version < 2.3 there is `box.error.NO_SUCH_FIELD` error for this case.
1 parent 6a1200a commit adf8df5

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/test_on_push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'tarantool'
1212
strategy:
1313
matrix:
14-
tarantool-version: ["1.10", "2.3", "2.4", "2.5"]
14+
tarantool-version: ["1.10", "2.2", "2.3", "2.4", "2.5"]
1515
fail-fast: false
1616
runs-on: [ubuntu-latest]
1717
steps:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
* Fixed not finding field in tuple on `crud.update` if
13+
there are `is_nullable` fields in front of it that were added
14+
when the schema was changed for Tarantool version <= 2.2.
15+
1016
### Added
1117

1218
* `mode`, `prefer_replica` and `balance` options for read operations

crud/common/utils.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ local function add_nullable_fields_recursive(operations, operations_map, space_f
212212
return operations
213213
end
214214

215-
-- Tarantool < 2.3 has no fields `box.error.NO_SUCH_FIELD_NO` and `box.error.NO_SUCH_FIELD_NAME`.
216-
if _TARANTOOL >= "2.3" then
215+
-- Tarantool < 2.1 has no fields `box.error.NO_SUCH_FIELD_NO` and `box.error.NO_SUCH_FIELD_NAME`.
216+
if _TARANTOOL >= "2.1" then
217217
function utils.is_field_not_found(err_code)
218218
return err_code == box.error.NO_SUCH_FIELD_NO or err_code == box.error.NO_SUCH_FIELD_NAME
219219
end

0 commit comments

Comments
 (0)