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

Fix #2986: correctly copy old data over when calling repalloc in parser #3011

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

Mytherin
Copy link
Collaborator

Fixes #2986

@@ -55,12 +55,17 @@ static void allocate_new(parser_state *state, size_t n) {

void *palloc(size_t n) {
// we need to align our pointers for the sanitizer
auto aligned_n = ((n + 7) / 8) * 8;
auto allocate_n = n + sizeof(size_t);
auto aligned_n = ((allocate_n + 7) / 8) * 8;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have a utility function for this somewhere? Align or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but since this is in the libpg_query library in the third_party folder we prefer not to link it back to the main DuckDB sources.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I figured, but thought I should ask.

@Mytherin Mytherin merged commit 180367f into duckdb:master Jan 31, 2022
@Mytherin Mytherin deleted the issue2986 branch June 21, 2022 07:07
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.

Long string with double apostrophe becomes empty string
2 participants