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
Query produce different results, depending on the presence of an index [CORE2232] #1008
Comments
Modified by: Svend Meyland Nicolaisen (smndk)description: The following test cases produce different results, depending on the presence of an index: ============================================================================== CREATE DATABASE 'localhost/3050:C:\Test1156.fdb' DEFAULT CHARACTER SET UTF8; INSERT INTO MyTable(Deleted,Name) VALUES(0,'Anders'); SELECT * FROM MyTable WHERE Name STARTING WITH 'A' COLLATE MyCollation AND Deleted=0; CREATE INDEX MyIndex ON MyTable (Deleted,Name); SELECT * FROM MyTable WHERE Name STARTING WITH 'A' COLLATE MyCollation AND Deleted=0; ============================================================================== create database 't2.fdb'; create index t_c on t (Deleted,c); ============================================================================== Adriano noted: Seems for me that when the last char is removed and an empty segment is looked, problem happen. It correct finds that one: Note: => The following test cases produce different results, depending on the presence of an index: ============================================================================== CREATE DATABASE 'localhost/3050:C:\Test1156.fdb' DEFAULT CHARACTER SET UTF8; INSERT INTO MyTable(Deleted,Name) VALUES(0,'Anders'); SELECT * FROM MyTable WHERE Name STARTING WITH 'A' COLLATE MyCollation AND Deleted=0; CREATE INDEX MyIndex ON MyTable (Deleted,Name); SELECT * FROM MyTable WHERE Name STARTING WITH 'A' COLLATE MyCollation AND Deleted=0; ============================================================================== create database 't2.fdb'; create index t_c on t (Deleted,c); ============================================================================== Adriano noted: Seems for me that when the last char is removed and an empty segment is looked, problem happen. It correct finds that one: Note: |
Commented by: @asfernandes The following test case demonstrates it's not a specific problem with INTL contractions. It should return two rows, but returns only one (with n = 1). execute block returns (n integer, deleted smallint, c varchar(10)) n = 1; |
Commented by: Svend Meyland Nicolaisen (smndk) I have now verified that the problem exists in version 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.1.0, 2.1.1, 2.5 Alpha 1 The problem does not exist in version 1.5.5. I have used the following script for the tests: create database 't2.fdb'; |
Modified by: Svend Meyland Nicolaisen (smndk)Version: 2.5 Alpha 1 [ 10224 ] Version: 2.0.4 [ 10211 ] Version: 2.1.0 [ 10041 ] Version: 2.0.3 [ 10200 ] Version: 2.0.2 [ 10130 ] Version: 2.0.1 [ 10090 ] Version: 2.0.0 [ 10091 ] |
Modified by: @asfernandes |
Commented by: @asfernandes Duplicates CORE1188. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Submitted by: Svend Meyland Nicolaisen (smndk)
Duplicates CORE1188
The following test cases produce different results, depending on the presence of an index:
==============================================================================
CREATE DATABASE 'localhost/3050:C:\Test1156.fdb' DEFAULT CHARACTER SET UTF8;
CREATE COLLATION MyCollation FOR UTF8 FROM UNICODE CASE INSENSITIVE 'LOCALE=da_DK';
CREATE TABLE MyTable (Deleted SMALLINT,Name VARCHAR(30) COLLATE MyCollation);
COMMIT;
INSERT INTO MyTable(Deleted,Name) VALUES(0,'Anders');
COMMIT;
SELECT * FROM MyTable WHERE Name STARTING WITH 'A' COLLATE MyCollation AND Deleted=0;
CREATE INDEX MyIndex ON MyTable (Deleted,Name);
COMMIT;
SELECT * FROM MyTable WHERE Name STARTING WITH 'A' COLLATE MyCollation AND Deleted=0;
==============================================================================
create database 't2.fdb';
create table t (Deleted SMALLINT,c varchar(10) character set win1250 collate pxw_csy); insert into t values (0,'ch');
SET PLAN;
select *
from t where c starting with 'c' AND Deleted=0; commit;
create index t_c on t (Deleted,c);
select * from t where c starting with 'c' and Deleted=0;
==============================================================================
Adriano noted:
Seems for me that when the last char is removed and an empty segment is looked, problem happen. It correct finds that one:
insert into t values (0, 'chch');
select * from t where c starting with 'chc' AND deleted = 0;
Note:
Probably applies to other versions too, such as 2.1.0.
The text was updated successfully, but these errors were encountered: