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

PJoinNode incorrectly calculates number of the column to perform JOIN on #6

Open
yeputons opened this issue Oct 22, 2017 · 0 comments

Comments

@yeputons
Copy link

The following code makes no sense:

    std::ptrdiff_t lpos1 = std::find(ln[i].begin(), ln[i].end(), ((LJoinNode*)prototype)->offset1) - ln[i].begin();
    std::ptrdiff_t lpos2 = std::find(ln[i].begin(), ln[i].end(), ((LJoinNode*)prototype)->offset2) - ln[i].begin();

    if (lpos1 <= ln.size() || lpos1 <= ln.size()) {
      if (lpos1 < lpos2)
        lpos = lpos1;
      else
        lpos = lpos2;
      break;
    }

For instance, the condition in the first if compares index in ln[i] with size of ln, which is meaningless. Also, lpos is assigned an index from ln[i] and it's later used as a column id, which makes no sense as well.

Example where this does not work: just make id column in table the last column and run demo

yeputons added a commit to yeputons/au-db-fall-2017 that referenced this issue Oct 23, 2017
@yeputons yeputons mentioned this issue Oct 23, 2017
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

No branches or pull requests

1 participant