Skip to content

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

@firebird-automations

Description

@firebird-automations

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions