Skip to content

Fix null pointer exception in Parser #20

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hezhengdong
Copy link

Thanks for this excellent course!

What is the issue?
When using the parser provided by the course to execute transaction commit and rollback, the Parser will first set the transaction to null, and then call the getId() method of the transaction when printing information, which will cause a null pointer exception.

What does this PR do?
Adjusting the order of codes.

How to reproduce the bug?
Start the Parser according to Lab2 2.7. Query Parser, then execute 'set transaction read only;', and then execute 'commit;' or 'rollback;'.

before fix:
image-20250313130411947
after fix:
image-20250313130545562

Please excuse me if I misunderstood any part of the logic.

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.

1 participant