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

Starting operator become unstable on indexed varchar fields #7237

Closed
aschegolskiy opened this issue Jul 21, 2022 · 9 comments
Closed

Starting operator become unstable on indexed varchar fields #7237

aschegolskiy opened this issue Jul 21, 2022 · 9 comments

Comments

@aschegolskiy
Copy link

Afer upgrading FB from version 3.0.6.33328 to 3.0.10.33601 behaviour of starting operator become unstable.
Sometimes it doesn't match strings that shoud be matched.

-- Metadata. Database created with default character set UTF8 and collation UNICODE_CI

CREATE TABLE TEST (STR_FIELD VARCHAR(10) CHARACTER SET UTF8 COLLATE UNICODE_CI);
CREATE INDEX TEST_IDX1 ON TEST (STR_FIELD);
INSERT INTO TEST (STR_FIELD) VALUES ('ПАПА');
-- Tests
select * from test where str_field starting 'П'    -- Found
select * from test where str_field starting 'ПА'   -- Not found
select * from test where str_field starting 'ПАП'  -- Found
select * from test where str_field starting 'ПАПА' -- Not found

Plan
--------------------------------------------------------------------------------
PLAN (TEST INDEX (TEST_IDX1))

I think it related with index on this field. If index isn't used, it works as expected.

-- Tests
select * from test where str_field || '' starting 'П'    -- Found
select * from test where str_field || '' starting 'ПА'   -- Found
select * from test where str_field || '' starting 'ПАП'  -- Found
select * from test where str_field || '' starting 'ПАПА' -- Found

Plan
--------------------------------------------------------------------------------
PLAN (TEST NATURAL)
@asfernandes asfernandes self-assigned this Jul 21, 2022
@asfernandes
Copy link
Member

I cannot reproduce this in Linux.

I even created the database, table and data in 3.0.6 and used it in 3.0.10.

All queries return data.

@aschegolskiy
Copy link
Author

I've tested it on:
Microsoft Windows Server 2008 R2 Enterprise 6.1.7601 Service Pack 1 build 7601
Microsoft Windows 10 Pro 10.0.19044 build 19044

@dyemanov
Copy link
Member

What is the connection charset?

@aschegolskiy
Copy link
Author

UTF8

@hvlad
Copy link
Member

hvlad commented Jul 21, 2022

I can confirm it using non-unicode console in Windows.
Checked with both dos866 and win1251 charset\codepage.

@aschegolskiy
Copy link
Author

Do I need to provide additional information?

@asfernandes
Copy link
Member

I now reproduced it in Windows.

@asfernandes
Copy link
Member

Please test fix in the next snapshot.

@aschegolskiy
Copy link
Author

I can confirm that it works on the snapshot build 3.0.11.33615 (Microsoft Windows 10 Pro 10.0.19044)
Thank you

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

5 participants