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

Wrong result in "similar to" with non latin characters [CORE6145] #6394

Closed
firebird-automations opened this issue Sep 18, 2019 · 23 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alex Bekhtin (afgm)

select * from rdb$database where 'Я' similar to '%Я%'

FB 3.0 - 1 line
FB 4.0 - 0 lines

Commits: 51ee150 6add872 093ba00

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

I wonder if this is the result of the changes for CORE5931

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

It's working for me in Linux.

@firebird-automations
Copy link
Collaborator Author

Commented by: Alex Bekhtin (afgm)

I loose first version of issue with environment description, sorry
Windows 7 64 bit, Firebird-4.0.0.1607 64 bit
downloaded from https://ci.appveyor.com/api/buildjobs/q9fkudf1i6aj7445/artifacts/output.zip

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

What's the connection charset?

Test case with isql, please.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

C:\FB\40SS>chcp 1251
1251

C:\FB\40SS>isql /:e40 -ch win1251
Database: /:e40, User: SYSDBA
SQL> set count on;
SQL> set heading off;
SQL> select 1 from rdb$database where 'Я' similar to '%Я%';
Records affected: 0
SQL> quit;

C:\FB\40SS>isql /:e40
Database: /:e40, User: SYSDBA
SQL> set count on;
SQL> set heading off;
SQL> select 1 from rdb$database where 'Я' similar to '%Я%';

       1

Records affected: 1
SQL>

SQL> show version;
ISQL Version: WI-T4.0.0.1607 Firebird 4.0 Beta 1
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-T4.0.0.1607 Firebird 4.0 Beta 1"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-T4.0.0.1607 Firebird 4.0 Beta 1/tcp (Image-PC1)/P16"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-T4.0.0.1607 Firebird 4.0 Beta 1/tcp (Image-PC1)/P16"
on disk structure version 13.0

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Also cannot reproduce in Windows with that download.

@firebird-automations
Copy link
Collaborator Author

Commented by: Alex Bekhtin (afgm)

SET NAMES WIN1251;
CONNECT '127.0.0.1/3053:D:\........fdb' USER 'SYSDBA' PASSWORD 'masterkey';

SQL> set list on;

SQL> select * from rdb$database where 'Я' similar to '%Я%';
SQL> select * from rdb$database where 'z' similar to '%z%';

RDB$DESCRIPTION <null>
RDB$RELATION_ID 238
RDB$SECURITY_CLASS SQL$363
RDB$CHARACTER_SET_NAME WIN1251
RDB$LINGER 300
RDB$SQL_SECURITY <null>

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Compare 1st case - when we *do* specify charset - with 3.0.5 (and also specify -ch ....):

C:\FB\30SS>isql /:e30 -ch win1251
Database: /:e30, User: SYSDBA
SQL> set count on;
SQL> set heading off;
SQL> select 1 from rdb$database where 'Я' similar to '%Я%';

       1

Records affected: 1
SQL> show version;
ISQL Version: WI-V3.0.5.33171 Firebird 3.0
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-V3.0.5.33171 Firebird 3.0"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-V3.0.5.33171 Firebird 3.0/tcp (Image-PC1)/P15"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-V3.0.5.33171 Firebird 3.0/tcp (Image-PC1)/P15"
on disk structure version 12.0
SQL>

@firebird-automations
Copy link
Collaborator Author

Commented by: Alex Bekhtin (afgm)

With charset NONE result is correct.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

environment: Windows 7 64bit

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

So to summarize:

FB v3.x Charset = none -- unknown
FB v3.x Charset = win1251 -- Pass

FB v4.x Charset = none -- Pass
FB v4.x Charset = win1251 -- Fail

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> So to summarize:
> FB v3.x Charset = none -- unknown

It is also PASSES.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Please try next snapshot.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Alex Bekhtin (afgm)

I test it. Small difference between 3.0 and 4.0 with case insensitive

3.0
select * from rdb$database where 's' similar to '%S%' -- False
select * from rdb$database where 'я' similar to '%Я%' -- False

4.0
select * from rdb$database where 's' similar to '%S%' -- True
select * from rdb$database where 'я' similar to '%Я%' -- False

@firebird-automations
Copy link
Collaborator Author

Commented by: Alex Bekhtin (afgm)

Another example:

select * from rdb$database where 'R' similar to 'r' -- True
select * from rdb$database where 'R' similar to 'R' -- True
select * from rdb$database where 'R' similar to '[Rr]' -- True
select * from rdb$database where 'Я' similar to 'я' -- False
select * from rdb$database where 'Я' similar to 'Я' -- True
select * from rdb$database where 'Я' similar to '[Яя]' -- False(!)

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Fixed. Please test again.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Issues of *this* ticket seems to be fixed, all fine with them.
But there are some other troubles with SIMILAR TO.
2 Adriano and dimitr: please check e-mail.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Pavel, I do not known what email are you talking about. I didn't received any email from you recently.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Adriano, perhaps you've changed e-mail ? I always wrote to this: mailto:adrianosf@gmail.com
Please send me empty letter to p519446 at http://yandex.ru

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Sorry, it was in my spam folder.

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