Skip to content

instr() is replaced with position() #2424

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

Closed
Totktonada opened this issue Nov 9, 2021 · 3 comments
Closed

instr() is replaced with position() #2424

Totktonada opened this issue Nov 9, 2021 · 3 comments

Comments

@Totktonada
Copy link
Member

Name and order of the arguments has changed for a better ANSI
compatibility:
Before: instr(haystack, needle).
After: position(needle, haystack).

Type checking became more strict: before it was
possible to call the function with INTEGER arguments
or with arguments of different types. Now both arguments
must have the same type and be either text or binary
strings.

Before the patch collations were not taken into
consideration during the search. Now it is fixed, and
both implicit (column) collations and explicit
(using COLLATE expression) are used. Single collation which
would be used in function is determined using ANSI
“Type combination” rules.

Requested by @SudoBobo in tarantool/tarantool@896f396

@Totktonada
Copy link
Member Author

It is from 2.2.2 / 2.2.1, but I found that the issue was never raised expcilitly. I see that the POSITION() function was added into the documentation in 67b32b2. Filed just in case: someone may want to verify that no details are missed.

Feel free to just close.

@pgulutzan
Copy link
Contributor

@Totktonada: The POSITION() documentation
https://www.tarantool.io/en/doc/latest/reference/reference_sql/sql_statements_and_clauses/#position
is correct and there's nothing about instr, but it's superseded in version 2.10, we no longer support POSITION() for varbinary. For what we're going to change regarding this function, see the pull request issue #2350. I suggest that this should be closed with no action.

@Totktonada
Copy link
Member Author

Okay, thanks!

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

No branches or pull requests

2 participants