| Bug #1627 | New Function: STRSPN(string1, string2) | ||
|---|---|---|---|
| Submitted: | 22 Oct 2003 9:32 | Modified: | 3 Feb 2012 13:34 |
| Reporter: | Andreas Delleske | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S4 (Feature request) |
| Version: | all | OS: | Any (all) |
| Assigned to: | CPU Architecture: | Any | |
[10 Dec 2005 17:27]
Valeriy Kravchuk
Thank you for a reasonable feature request.
[3 Feb 2012 13:34]
Andreas Delleske
It is somewhat funny to see that a reasonable feature request of mine has been submitted in 2003, acknowledged as reasonable in 2005 but nothing happened since..

Description: In my opinion, there should be a function like integer STRSPN(string1, string2) (see same function name and meaning in PHP4!) which counts the numbers of equal characters in string1 and string2, beginning with the first characters in each and sttopping by the first unequal character: STRSPN("horsepower","horseshoe") = 5 STRSPN("foo", "bar") = 0 (an obligatory example! :-)) STRSPN("horsecat", "ho") = 2 ... The "moral justification" :-) of this feature request is that the number of adjacent characters is at hand anyway at every string comparison and needs no extra calculations! (Well maybe the normal comparison algorithm compares 4 bytes at once... but there should be a solution...) Without this function, things have to be made with much more hassle and subqueries and so on... How to repeat: its not a bug, its a feature (request :-) Suggested fix: soon :-))