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

refactor(expr): unify {octet,bit}_length for varchar and bytea #10705

Closed
xiangjinwu opened this issue Jul 3, 2023 · 0 comments · Fixed by #10780
Closed

refactor(expr): unify {octet,bit}_length for varchar and bytea #10705

xiangjinwu opened this issue Jul 3, 2023 · 0 comments · Fixed by #10780
Assignees
Milestone

Comments

@xiangjinwu
Copy link
Contributor

          tip: You can use generic function to unify them.
#[function("length(bytea) -> int32")]
#[function("octet_length(bytea) -> int32")]
#[function("octet_length(varchar) -> int32")]
pub fn octet_length(s: impl AsRef<[u8]>) -> i32 {
    s.as_ref().len() as i32
}

Originally posted by @wangrunji0408 in #10462 (comment)

@xiangjinwu xiangjinwu self-assigned this Jul 3, 2023
@github-actions github-actions bot added this to the release-0.20 milestone Jul 3, 2023
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 a pull request may close this issue.

1 participant