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

Wrong comparison between operation response code and request code #141

Closed
nicktorwald opened this issue Mar 22, 2019 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@nicktorwald
Copy link

It seems we have a regression in scope of SQL request completion after 9471340.

  1. here we get operation response code.
  2. Next line compares code status against 0 (success)
  3. If true the same code status is compared with EXECUTE (11) request code which always leads to be evaluated to false (0 never equals 11).
  4. As a result, completeSql method will never be called anymore.
protected void complete(TarantoolPacket packet, CompletableFuture<?> q) {
        if (q != null) {
            long code = packet.getCode();
            if (code == 0) {

                if (code == Code.EXECUTE.getId()) {  // 0 == 11 always evaluates to false
                    completeSql(q, packet);
                } else {
                    ((CompletableFuture) q).complete(packet.getBody().get(Key.DATA.getId()));
                }
            } else {
                Object error = packet.getBody().get(Key.ERROR.getId());
                fail(q, serverError(code, error));
            }
        }
    }
@nicktorwald nicktorwald added the bug Something isn't working label Mar 22, 2019
nicktorwald added a commit that referenced this issue Mar 29, 2019
Fix a regression related to processing of SQL response.
Fix a wrong parsing of SQL tuple result.

Fixes: #141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant