You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
<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;
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
The text was updated successfully, but these errors were encountered: