Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty error on zero rows input #377

Closed
DifferentialOrange opened this issue Sep 26, 2023 · 0 comments
Closed

Empty error on zero rows input #377

DifferentialOrange opened this issue Sep 26, 2023 · 0 comments
Assignees
Labels
1sp bug Something isn't working teamE

Comments

@DifferentialOrange
Copy link
Member

DifferentialOrange commented Sep 26, 2023

./doc/playground.lua
tarantool> crud.insert_object_many('customers', {})
---
- null
- []
...

If an empty array is passed as argument, result is nil, errs, yet errs is an empty array.

The case may seem synthetic at the first glance, but it is rather easy to get into such situation while calling CRUD from go-tarantool and spend a couple of hours trying to explore what went wrong when error is non-nil, yet empty.

@DifferentialOrange DifferentialOrange added the bug Something isn't working label Oct 5, 2023
@DifferentialOrange DifferentialOrange self-assigned this Oct 5, 2023
DifferentialOrange added a commit that referenced this issue Oct 5, 2023
Before this patch, the behavior of `*_many` requests if empty array of
tuples/objects were rather confusing. For example, due to format
processing all `*_object_many` operations resulted in `nil, {}` --
error request with zero errors. `insert_many` and `replace_many` calls
result in `nil, nil` -- no result, no error. `upsert_many` results in
`{metadata = metadata}, nil` with no `rows` in response. Thus, for all
six `*_many` calls trying to execute the request with empty array on
input result in malformed response.

After this patch, trying to run `*_many` request with empty array of
tuples/objects will result in `nil, {err}`, similar to existing
`*_many` API. Single tuple crud API already does not allow to run with
no tuples/objects.

Closes #377
DifferentialOrange added a commit that referenced this issue Oct 5, 2023
Before this patch, the behavior of `*_many` requests if empty array of
tuples/objects were rather confusing. For example, due to format
processing all `*_object_many` operations resulted in `nil, {}` --
error request with zero errors. `insert_many` and `replace_many` calls
result in `nil, nil` -- no result, no error. `upsert_many` results in
`{metadata = metadata}, nil` with no `rows` in response. Thus, for all
six `*_many` calls trying to execute the request with empty array on
input result in malformed response.

After this patch, trying to run `*_many` request with empty array of
tuples/objects will result in `nil, {err}`, similar to existing
`*_many` API. Single tuple crud API already does not allow to run with
no tuples/objects.

Closes #377
DifferentialOrange added a commit that referenced this issue Oct 5, 2023
Before this patch, the behavior of `*_many` requests if empty array of
tuples/objects were rather confusing. For example, due to format
processing all `*_object_many` operations resulted in `nil, {}` --
error request with zero errors. `insert_many` and `replace_many` calls
result in `nil, nil` -- no result, no error. `upsert_many` results in
`{metadata = metadata}, nil` with no `rows` in response. Thus, for all
six `*_many` calls trying to execute the request with empty array on
input result in malformed response.

After this patch, trying to run `*_many` request with empty array of
tuples/objects will result in `nil, {err}`, similar to existing
`*_many` API. Single tuple crud API already does not allow to run with
no tuples/objects.

Closes #377
DifferentialOrange added a commit that referenced this issue Oct 9, 2023
Before this patch, the behavior of `*_many` requests if empty array of
tuples/objects were rather confusing. For example, due to format
processing all `*_object_many` operations resulted in `nil, {}` --
error request with zero errors. `insert_many` and `replace_many` calls
result in `nil, nil` -- no result, no error. `upsert_many` results in
`{metadata = metadata}, nil` with no `rows` in response. Thus, for all
six `*_many` calls trying to execute the request with empty array on
input result in malformed response.

After this patch, trying to run `*_many` request with empty array of
tuples/objects will result in `nil, {err}`, similar to existing
`*_many` API. Single tuple crud API already does not allow to run with
no tuples/objects.

Closes #377
DifferentialOrange added a commit that referenced this issue Oct 9, 2023
Before this patch, the behavior of `*_many` requests if empty array of
tuples/objects were rather confusing. For example, due to format
processing all `*_object_many` operations resulted in `nil, {}` --
error request with zero errors. `insert_many` and `replace_many` calls
result in `nil, nil` -- no result, no error. `upsert_many` results in
`{metadata = metadata}, nil` with no `rows` in response. Thus, for all
six `*_many` calls trying to execute the request with empty array on
input result in malformed response.

After this patch, trying to run `*_many` request with empty array of
tuples/objects will result in `nil, {err}`, similar to existing
`*_many` API. Single tuple crud API already does not allow to run with
no tuples/objects.

Closes #377
DifferentialOrange added a commit that referenced this issue Oct 10, 2023
Before this patch, the behavior of `*_many` requests if empty array of
tuples/objects were rather confusing. For example, due to format
processing all `*_object_many` operations resulted in `nil, {}` --
error request with zero errors. `insert_many` and `replace_many` calls
result in `nil, nil` -- no result, no error. `upsert_many` results in
`{metadata = metadata}, nil` with no `rows` in response. Thus, for all
six `*_many` calls trying to execute the request with empty array on
input result in malformed response.

After this patch, trying to run `*_many` request with empty array of
tuples/objects will result in `nil, {err}`, similar to existing
`*_many` API. Single tuple crud API already does not allow to run with
no tuples/objects.

Closes #377
DifferentialOrange added a commit that referenced this issue Oct 16, 2023
Overview

  This release improves experience for VShard clusters users and
  Tarantool 3 users. It also introduces schema introspection API.

New features

  * Space schema introspection API `crud.schema` (#380).

Bugfixes

  * Return explicit error for `*_many` call with
    no tuples/objects (#377).
  * `crud.readview` resource cleanup on garbage collect (#379).
  * VShard storage user have not execution rights for
    internal functions (#366).

Infrastructure

  * `deps.sh` installs the `vshard` instead of the `cartridge`
    by default (#364). You could to specify an environment variable
    `CARTIRDGE_VERSION` to install the `cartridge` and run tests cases
    with it.
  * `doc/playground.lua` does not work with Tarantool 3 (#371).
  * Tests with Tarantool 3 (#364).
  * Quickstart section in the README.md focuses on usage with `vshard`
    instead of `Cartridge` (#366).
DifferentialOrange added a commit that referenced this issue Oct 16, 2023
Overview

  This release improves experience for VShard clusters users and
  Tarantool 3 users. It also introduces schema introspection API.

New features

  * Space schema introspection API `crud.schema` (#380).

Bugfixes

  * Return explicit error for `*_many` call with
    no tuples/objects (#377).
  * `crud.readview` resource cleanup on garbage collect (#379).
  * VShard storage user have not execution rights for
    internal functions (#366).
  * Compatibility with Tarantool 3.0 tuple objects (#387).

Infrastructure

  * `deps.sh` installs the `vshard` instead of the `cartridge`
    by default (#364). You could to specify an environment variable
    `CARTIRDGE_VERSION` to install the `cartridge` and run tests cases
    with it.
  * `doc/playground.lua` does not work with Tarantool 3 (#371).
  * Tests with Tarantool 3 (#364).
  * Quickstart section in the README.md focuses on usage with `vshard`
    instead of `Cartridge` (#366).
DifferentialOrange added a commit that referenced this issue Oct 16, 2023
Overview

  This release improves experience for VShard clusters users and
  Tarantool 3 users. It also introduces schema introspection API.

New features

  * Space schema introspection API `crud.schema` (#380).

Bugfixes

  * Return explicit error for `*_many` call with
    no tuples/objects (#377).
  * `crud.readview` resource cleanup on garbage collect (#379).
  * VShard storage user have not execution rights for
    internal functions (#366).
  * Compatibility with Tarantool 3.0 tuple objects (#387).

Infrastructure

  * `deps.sh` installs the `vshard` instead of the `cartridge`
    by default (#364). You could to specify an environment variable
    `CARTIRDGE_VERSION` to install the `cartridge` and run tests cases
    with it.
  * `doc/playground.lua` does not work with Tarantool 3 (#371).
  * Tests with Tarantool 3 (#364).
  * Quickstart section in the README.md focuses on usage with `vshard`
    instead of `Cartridge` (#366).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1sp bug Something isn't working teamE
Projects
None yet
Development

No branches or pull requests

2 participants