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

server: restore exec() sparse output support #351

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Jan 19, 2024

After [1], returning values after nil (for example, classic return nil, err scenario) is broken. This patch restores the behavior. Since server doesn't always has access to require('luatest.utils'), utility is provided through its dump. Since net.box already handles nil args input with box.NULL, everything is fine for exec arguments.

  1. e6a2093

I didn't forget about

  • Tests
  • Changelog
  • Documentation (bugfix)

Close #350

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-350-nil-unpack branch from ea2cc8d to 3eb6f10 Compare January 19, 2024 09:31
@DifferentialOrange DifferentialOrange changed the title exec: sparse input and output support exec: restore sparse output support Jan 19, 2024
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-350-nil-unpack branch from 3eb6f10 to 962241b Compare January 19, 2024 10:06
@DifferentialOrange DifferentialOrange marked this pull request as ready for review January 19, 2024 10:09
Copy link
Contributor

@ochaplashkin ochaplashkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change the the commit message
from
exec: ...
to
server: restore sparse output support from exec

After [1], returning values after nil (for example, classic
`return nil, err` scenario) is broken. This patch restores the behavior.

Since server doesn't always has access to `require('luatest.utils')`,
utility is provided through its dump.

Since `net.box` already handles `nil` args input with `box.NULL`,
everything is fine for exec arguments.

1. e6a2093

Closes #350
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-350-nil-unpack branch from 962241b to c8b69bf Compare January 19, 2024 11:07
@DifferentialOrange
Copy link
Member Author

Let's change the the commit message from exec: ... to server: restore sparse output support from exec

That's fair, updated

@DifferentialOrange DifferentialOrange changed the title exec: restore sparse output support server: restore exec() sparse output support Jan 19, 2024
@ochaplashkin ochaplashkin self-requested a review January 19, 2024 11:11
Copy link
Contributor

@ochaplashkin ochaplashkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@ochaplashkin ochaplashkin merged commit 0c06b68 into master Jan 19, 2024
11 checks passed
@ochaplashkin ochaplashkin deleted the DifferentialOrange/gh-350-nil-unpack branch January 19, 2024 11:12
DifferentialOrange added a commit that referenced this pull request Jan 19, 2024
Simplify code from PR #351 based on @Totktonada advice.

Follows #350
ochaplashkin pushed a commit that referenced this pull request Jan 19, 2024
Simplify code from PR #351 based on @Totktonada advice.

Follows #350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Second value after nil is not returned from server.exec
2 participants