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 panic on wrong number of arguments to substr #12837

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

eejbyfeldt
Copy link
Contributor

@eejbyfeldt eejbyfeldt commented Oct 9, 2024

Which issue does this PR close?

Closes #12699.

Rationale for this change

Fixes a panic.

What changes are included in this PR?

Adds guard that checks that we are passed a correct number of arguments to substr.

Are these changes tested?

Existing and a new test.

Are there any user-facing changes?

No.

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) functions labels Oct 9, 2024
@eejbyfeldt eejbyfeldt marked this pull request as ready for review October 9, 2024 19:54
Copy link
Member

@jonahgao jonahgao left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @eejbyfeldt

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @eejbyfeldt

This is a pretty good example of how having unified handling of coercion (e.g. not custom coercion logic) would have saved us a bug @jayzhan211 and @findepi

@alamb alamb merged commit 43d0bcf into apache:main Oct 10, 2024
25 checks passed
@findepi
Copy link
Member

findepi commented Oct 11, 2024

thank you @eejbyfeldt !
@alamb could we try to make substr use signature::exact or something like that?

@alamb
Copy link
Contributor

alamb commented Oct 15, 2024

@alamb could we try to make substr use signature::exact or something like that?

that sounds like a good idea to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when an invalid expression in GROUP BY clause (SQLancer)
4 participants