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

[YSQL] Batched Nested Loop joins crash on prepared statements in yb-sample-apps #14278

Closed
tanujnay112 opened this issue Sep 30, 2022 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage

Comments

@tanujnay112
Copy link
Contributor

tanujnay112 commented Sep 30, 2022

Jira Link: DB-3722

Description

The prepared joins for the SqlForeignKeysAndJoins workload of the yb-sample-apps repository causes a connection crash when BatchedNestedLoop joins are enabled. This happens when the statement reuses a plan from a previous run and accesses invalid memory in the YBBatchedNestLoop node here.

@tanujnay112 tanujnay112 added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Sep 30, 2022
@tanujnay112 tanujnay112 self-assigned this Sep 30, 2022
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Sep 30, 2022
tanujnay112 added a commit that referenced this issue Oct 1, 2022
…eep copy for its fields

Summary:
`_copyYbBatchedNestLoop` in `copyfuncs.c` was doing a shallow copy of its `nl` field. This results in the field having invalid fields when a copy of a `YbBatchedNestLoop` plan is reused over multiple connections. This revision fixes that issue by adding the appropriate copy logic in `_copyYbBatchedNestLoop`.

This revision also fixes a couple glaring cosmetic issues in code relevant to batched nested loop joins.

Test Plan:
./yb_build.sh release --java-test 'org.yb.pgsql.TestPgMisc'

Reviewers: rskannan, amartsinchyk

Reviewed By: amartsinchyk

Differential Revision: https://phabricator.dev.yugabyte.com/D19919
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage
Projects
None yet
Development

No branches or pull requests

2 participants