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 #5853: fully qualify function names inside macros during the binding process #5856

Merged
merged 1 commit into from
Jan 8, 2023

Conversation

Mytherin
Copy link
Collaborator

@Mytherin Mytherin commented Jan 8, 2023

Fixes #5853

During binding we extend unqualified function calls with the catalog and schema information of the function we found, e.g.:

CREATE MACRO "sum"(x) AS (CASE WHEN sum(x) IS NULL THEN 0 ELSE sum(x) END);
-- becomes
CREATE MACRO "sum"(x) AS (CASE WHEN system.main.sum(x) IS NULL THEN 0 ELSE system.main.sum(x) END);

This prevents recursive macros from being created, where during initial binding we bind to system.main.sum, but during subsequent binding we bind to the same macro again (db.main.sum).

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.

Segmentation fault when creating a macro that references a function with the same name
1 participant