Skip to content

Conversation

evtrouble
Copy link
Contributor

Fix memory leak of token when bison failed to parse SQL.
Use left recursion for better performance and remove vector reverse.

What problem were solved in this pull request?

When bison fails to parse SQL, memory leaks may occur, such as
select * from t where id><1;

Issue Number: close #308

Problem:

What is changed and how it works?

In yacc_sql.y, use %destructor to specify the memory release action that needs to be called when parsing fails for the token, in order to prevent memory leaks that may occur in the event of an error.

Other information

Use left recursion for better performance and remove vector reverse.
@hnwyllmm hnwyllmm merged commit 90d6851 into oceanbase:main Jul 31, 2025
15 checks passed
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.

[BUG]memory leak during parser and parser improvement

2 participants