-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
SIMILAR TO with quantifier {n,} in the pattern: 1) fails on 2.5 ("Invalid pattern"), 2) strange result in 3.0 [CORE4740] #5045
Comments
Commented by: @pavel-zotov It seems that something is broken now in WI-V2.5.4.26857. These is examples from doc ( http://www.firebirdsql.org/refdocs/langrefupd25-similar-to.html ): SQL> select iif( 'Erdbeere' similar to '[[:ALPHA:]]', 1, 0 ) r from rdb$database; -- OK
============ -- The following FAILS, but character classes must be case-insensitive since fixed CORE2952, SQL> select iif( 'Erdbeere' similar to '[[:alpha:]]', 1, 0 ) r from rdb$database;
============ ----------------------------------------------------------------------------------------------------------- -- This also FAILS despite that http://www.firebirdsql.org/refdocs/langrefupd25-similar-to.html DOES contain sample SQL> select iif( 'Erdbeere' similar to [[:ALPHA:]], 1, 0 ) r from rdb$database; |
Commented by: @asfernandes 2.5 problem: It should be LOWER, not lower. |
Commented by: @pavel-zotov You're right, it was my mistake applying pattern in lower-case for 2.5. But what about 3.0 (tested on WI-T3.0.0.31840 and LI-T3.0.0.31827) ? select iif( 'abcz' similar to '[[:LOWER:]]{1,}z', 1, 0) result from rdb$database; -- NB: letter 'Z' - in lower case, as all preceding ones
============ select iif( 'abcz' similar to '[[:lower:]]{1,}z', 1, 0) result from rdb$database; -- NB: letter 'Z' - in lower case, as all preceding ones
============ FB 2.5 returns 1 for the first statement (and 'invalid pattern' for 2nd but it must be so). |
Commented by: @asfernandes For uppercase/lowercase, please search the bug tracker. Hint: CORE2952 About the wrong result, I'm investigating. |
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Beta 2 [ 10586 ] |
Commented by: @pavel-zotov It seems that fix ( http://sourceforge.net/p/firebird/code/61585 ) isn`t completed: set list on; On WI-V2.5.5.26871: RESULT 1 On WI-T3.0.0.31844: RESULT 0 PS. And this: select iif('aggagg' similar to '([[:LOWER:]]{1,}gg){2,}', 1, 0) result from rdb$database; -- works OK on 3.0 The only difference is in the comma inside quantifier after [[:LOWER:]] class: But text 'agg' has EXACT ONE character leftside of 'gg', so why we can`t specify this by {1} -- i.e. *without* comma ? |
Commented by: @pavel-zotov Ticket should be reopened. Following query:with
|
Commented by: @pavel-zotov PS. select iif('aggagg' similar to '(a{0,}%){2}', 1, 0) result from rdb$database; -- leads to (both in FB 2.5 & 3.0):Invalid String.
|
Commented by: @asfernandes select iif('aggagg' similar to '(a{0,}%){2}', 1, 0) result from rdb$database; is not supported by our engine and will not be fixed in this ticket. The others cases are fixed. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] |
Submitted by: @pavel-zotov
case-1: select iif( 'abcZ' similar to '[[:lower:]]{1,}Z', 1, 0) result from rdb$database; -- NB: letter 'Z' - in upper case
case-2: select iif( 'abcz' similar to '[[:lower:]]{1,}z', 1, 0) result from rdb$database; -- NB: letter 'Z' - in lower case, as all preceding ones
Result in WI-V2.5.4.26857 for both cases:
Statement failed, SQLSTATE = 42000
Invalid SIMILAR TO pattern
Result in WI-T3.0.0.31780:
SQL> select iif( 'abcZ' similar to '[[:lower:]]{1,}Z', 1, 0) result from rdb$database;
============
1
SQL> select iif( 'abcz' similar to '[[:lower:]]{1,}z', 1, 0) result from rdb$database;
============
0
Why second matching fails if we have three letters in lowercase left side from 'z' ?
If SIMILAR-engine count characters upto final one ('z') when it encounteres {1,} than why it does NOT so in the following cases (and these are also seems "invalid" for 2.5 as above):
SQL> select iif( 'abcz' similar to '[[:lower:]]*z', 1, 0) result from rdb$database;
============
1
SQL> select iif( 'abcz' similar to '[[:lower:]]+z', 1, 0) result from rdb$database;
============
1
-- ?
Commits: c8e7c92 003be80 FirebirdSQL/fbt-repository@8818460 FirebirdSQL/fbt-repository@d0c123a
====== Test Details ======
See also CORE3754, CORE2006
The text was updated successfully, but these errors were encountered: