SIMILAR TO works wrongly
------------------------

                 Key: CORE-3754
                 URL: http://tracker.firebirdsql.org/browse/CORE-3754
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.1
            Reporter: Artem Kudlaenko


1. Next SIMILAR TO queries return 'false':

SELECT CASE WHEN '1' SIMILAR TO '(1|2){0,}' ESCAPE '\' THEN 'true' else 'false' 
end
FROM RDB$DATABASE;
  
SELECT CASE WHEN '1' SIMILAR TO '(1|2){0,1}' ESCAPE '\' THEN 'true' else 
'false' end
FROM RDB$DATABASE;

But this query return 'true':

SELECT CASE WHEN '1' SIMILAR TO '(1|2){1}' ESCAPE '\' THEN 'true' else 'false' 
end
FROM RDB$DATABASE;

2. Next SIMILAR TO query return 'false':

SELECT CASE WHEN '123' SIMILAR TO '(1|12[3]?){1}' ESCAPE '\' THEN 'true' else 
'false' end
FROM RDB$DATABASE;

But this query return 'true':

SELECT CASE WHEN '123' SIMILAR TO '(1|12[3]?)+' ESCAPE '\' THEN 'true' else 
'false' end
FROM RDB$DATABASE;


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to