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

sql: strpos not supported with bit types #45849

Closed
andy-kimball opened this issue Mar 8, 2020 · 4 comments · Fixed by #46875
Closed

sql: strpos not supported with bit types #45849

andy-kimball opened this issue Mar 8, 2020 · 4 comments · Fixed by #46875
Assignees
Labels
A-sql-builtins SQL built-in functions and semantics thereof. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) good first issue

Comments

@andy-kimball
Copy link
Contributor

Repro:

root@:26257/defaultdb> SELECT position(B'1010' IN B'00001010');
ERROR: unknown signature: strpos(varbit, varbit)

EXPECTED: No error, PG returns this:

template1=# SELECT position(B'1010' IN B'00001010');
 position
----------
        5
@andy-kimball
Copy link
Contributor Author

Good first issue?

@jordanlewis jordanlewis added good first issue C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-builtins SQL built-in functions and semantics thereof. labels Mar 8, 2020
@sandyleo26
Copy link

happy to tackle this as well.

@abhishek20123g
Copy link
Contributor

happy to this one too 😊.

@jordanlewis
Copy link
Member

@abhishek20123g as usual, go ahead and make a PR - there's no need to comment on the issue first. Thanks for your interest in contributing!

craig bot pushed a commit that referenced this issue Apr 7, 2020
46875: sql: allow strpos() builtin function to support bit and bytes array r=otan a=abhishek20123g

Fixes #45849

This commit modified strpos builtin function to allow it to
support bit and byte array and add their respective testcases.

This PR creates separate overloads for both bit and bytes as:
strpos(varbit, varbit)
strpos(bytes, bytes)
since POSITION is an alias for strpos, at the parser level.
Therefore this PR affect POSITION too.

Release justification: low-risk change to existing functionality.

Release note (sql change): This PR modified strpos() function
to allow it support bit and byte array.

Co-authored-by: abhishek20123g <[email protected]>
@craig craig bot closed this as completed in cc1d400 Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-builtins SQL built-in functions and semantics thereof. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants