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

Correct documentation: closing curly brace ( "}" ) need to be added to the list of special characters in SIMILAR TO (because it also need to be escaped). [DOC118] #124

Closed
firebird-automations opened this issue Dec 25, 2015 · 0 comments

Comments

@firebird-automations
Copy link

Submitted by: @pavel-zotov

From SIMILAR TO documentation:

<special character> ::= any of the characters []()|^-+*%_?{

Here we can see that list finished with opening curly brace. But *closing* "}" also need to be escaped.
Sample:

C:\MIX\firebird\OLTPTEST>isql /3333:"C:\MIX\firebird\OLTPTEST\OLTP30{smaLL}.FDB"
Database: /3333:C:\MIX\firebird\OLTPTEST\OLTP30{smaLL}.FDB, User: SYSDBA
SQL> set list on;
SQL> select mon$database_name from mon$database;

MON$DATABASE_NAME

===============================================================================
C:\MIX\FIREBIRD\OLTPTEST\OLTP30{SMALL}.FDB

SQL> set list on; select 1 from mon$database where mon$database_name similar to '%[\\/](OLTP30\{SMALL\}).FDB' escape '\'; ----- has '\' before "}"

CONSTANT 1

SQL> set list on; select 1 from mon$database where mon$database_name similar to '%[\\/](OLTP30\{SMALL}).FDB' escape '\'; ----- hasn't '\' before '}'

Statement failed, SQLSTATE = 42000
Invalid SIMILAR TO pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants