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
Error in selecting rows with compound index [CORE3971] #4304
Comments
Commented by: @dyemanov Did you perform backup/restore or at least rebuild indices during migration to 2.5.2 / 2.5.3? If not, try that and report back. Also, what version did you run before trying those recent builds? Some earlier snapshot of 2.5.2, I guess? What build number? |
Commented by: Jesus Angel Garcia Zarco (cointec) This test is done creating that table in firebird 2.5.3. I have tested again in my laptop with version 2.5.2.26469, and has the same bug. I have not backed up and restored, but I have set the index Inactive and active. The first time I tested it, instead of run select FIELD_ID, FIELD_DESC, FIELD_SEL I runned select FIELD_ID, FIELD_DESC, FIELD_SEL The latter runs fine. I do change the description and instead of latest 2.5.2 write 2.5.2. |
Modified by: Jesus Angel Garcia Zarco (cointec)description: I have observed an strange behaviour in the latest snapshots of Firebird 2.5.2 and in recent snapshots of 2.5.3. I think is a bug related to some changes introduced in recent builds that solves other bugs related to index corruptions. I have one table with a compound index smallint+varchar. CREATE TABLE NEW_TABLE ( CREATE INDEX NEW_TABLE_IDX1 ON NEW_TABLE (FIELD_ID, FIELD_DESC); INSERT INTO NEW_TABLE (FIELD_ID, FIELD_DESC, FIELD_SEL) If I execute the next statement, all runs fine and returns all rows. select FIELD_ID, FIELD_DESC, FIELD_SEL 1 '' 1 If i execute the same query, but parametrized, i get two rows: Search = '' select FIELD_ID, FIELD_DESC, FIELD_SEL 1 '' 1 The interesting thing, is that if I now execute the next update update NEW_TABLE and then execute again select FIELD_ID, FIELD_DESC, FIELD_SEL I get 1 '' 1 and allways if i execute select FIELD_ID, FIELD_DESC, FIELD_SEL or select FIELD_ID, FIELD_DESC, FIELD_SEL returns all rows. => I have observed an strange behaviour in Firebird 2.5.2 and in recent snapshots of 2.5.3. I think is a bug related to some changes introduced in recent builds that solves other bugs related to index corruptions. I have one table with a compound index smallint+varchar. CREATE TABLE NEW_TABLE ( CREATE INDEX NEW_TABLE_IDX1 ON NEW_TABLE (FIELD_ID, FIELD_DESC); INSERT INTO NEW_TABLE (FIELD_ID, FIELD_DESC, FIELD_SEL) If I execute the next statement, all runs fine and returns all rows. select FIELD_ID, FIELD_DESC, FIELD_SEL 1 '' 1 If i execute the same query, but parametrized, i get two rows: Search = '' select FIELD_ID, FIELD_DESC, FIELD_SEL 1 '' 1 The interesting thing, is that if I now execute the next update update NEW_TABLE and then execute again select FIELD_ID, FIELD_DESC, FIELD_SEL I get 1 '' 1 and allways if i execute select FIELD_ID, FIELD_DESC, FIELD_SEL or select FIELD_ID, FIELD_DESC, FIELD_SEL returns all rows. |
Commented by: Jesus Angel Garcia Zarco (cointec) I'm testing with version 2.5.2.26466 and 2.5.2.26387 and does not runs fine |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: No test => Covered by another test(s) |
Submitted by: Jesus Angel Garcia Zarco (cointec)
Duplicates CORE1188
I have observed an strange behaviour in Firebird 2.5.2 and in recent snapshots of 2.5.3. I think is a bug related to some changes introduced in recent builds that solves other bugs related to index corruptions.
I have one table with a compound index smallint+varchar.
CREATE TABLE NEW_TABLE (
FIELD_ID INTEGER NOT NULL,
FIELD_DESC VARCHAR(10) NOT NULL,
FIELD_SEL SMALLINT NOT NULL
);
CREATE INDEX NEW_TABLE_IDX1 ON NEW_TABLE (FIELD_ID, FIELD_DESC);
CREATE INDEX NEW_TABLE_IDX2 ON NEW_TABLE (FIELD_SEL, FIELD_DESC);
INSERT INTO NEW_TABLE (FIELD_ID, FIELD_DESC, FIELD_SEL)
VALUES (1, '', 1);
INSERT INTO NEW_TABLE (FIELD_ID, FIELD_DESC, FIELD_SEL)
VALUES (2, '', 1);
INSERT INTO NEW_TABLE (FIELD_ID, FIELD_DESC, FIELD_SEL)
VALUES (3, 'B', 1);
If I execute the next statement, all runs fine and returns all rows.
select FIELD_ID, FIELD_DESC, FIELD_SEL
from new_table
where FIELD_SEL = 1 and FIELD_DESC starting with ''
1 '' 1
2 '' 1
3 'B' 1
If i execute the same query, but parametrized, i get two rows:
Search = ''
select FIELD_ID, FIELD_DESC, FIELD_SEL
from new_table
where FIELD_SEL = 1 and FIELD_DESC starting with :Search
1 '' 1
2 '' 1
The interesting thing, is that if I now execute the next update
update NEW_TABLE
set FIELD_DESC = 'A'
where FIELD_ID = 2
and then execute again
select FIELD_ID, FIELD_DESC, FIELD_SEL
from new_table
where FIELD_SEL = 1 and FIELD_DESC starting with :Search
I get
1 '' 1
2 'A' 1
and allways if i execute
select FIELD_ID, FIELD_DESC, FIELD_SEL
from new_table
where FIELD_SEL = 1 and FIELD_DESC starting with ''
or
select FIELD_ID, FIELD_DESC, FIELD_SEL
from new_table
where FIELD_DESC starting with :Search
returns all rows.
====== Test Details ======
See test for core-1188
The text was updated successfully, but these errors were encountered: