Skip to content

Support for partial indices#7257

Merged
dyemanov merged 13 commits intomasterfrom
partial-idx
Oct 19, 2022
Merged

Support for partial indices#7257
dyemanov merged 13 commits intomasterfrom
partial-idx

Conversation

@dyemanov
Copy link
Copy Markdown
Member

As requested in #3750. Also supported by MS SQL, PostgreSQL, SQLite, MongoDB. Brief description can be found in Wikipedia.

@dyemanov dyemanov marked this pull request as ready for review August 12, 2022 13:35
@livius2
Copy link
Copy Markdown

livius2 commented Aug 12, 2022

Thank you for implementing this. Next step partial Foreign Key like in #7260

Comment thread src/burp/backup.epp
FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle1)
X IN RDB$INDICES WITH
X.RDB$RELATION_NAME EQ relation->rel_name
if (tdgbl->runtimeODS >= DB_VERSION_DDL13_1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff comparation is not easy here.

Can't we use unique code where non-existent fields are read as NULL?

Or are you preventing problem of new gbak being connected to very old engine that treat non-existent fields as error?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is to please old engine versions.

Comment thread src/burp/restore.epp Outdated
general_on_error ();
END_ERROR;

if (hasConditionSrc || hasConditionBlr)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Write to non-existent fields is possible since many versions ago.

@asfernandes
Copy link
Copy Markdown
Member

I suppose that if v4 opens an ODS 13.1 database with partial index, it may not work properly, trying to find entries in index without considering its condition, correct?

Do we consider these cases as valid for minor ODS upgrade?

@dyemanov
Copy link
Copy Markdown
Member Author

I suppose that if v4 opens an ODS 13.1 database with partial index, it may not work properly, trying to find entries in index without considering its condition, correct?

Do we consider these cases as valid for minor ODS upgrade?

v4 cannot attach an ODS 13.1 database.

@AppVeyorBot
Copy link
Copy Markdown

Build firebird 1.0.4757 completed (commit 91eb884b4f by @hvlad)

@dyemanov dyemanov self-assigned this Oct 18, 2022
@pavel-zotov
Copy link
Copy Markdown

Following script causes FB crash (checked on 5.0.0.938; problem in line marked as "[ ! ]"):

set bail on;
shell del c:\temp\tmp4test.fdb 2>nul;
create database 'localhost:c:\temp\tmp4test.fdb';
show version;
set list on;
set echo on;
recreate table test(
    id int primary key
    ,f01 int
    ,f02 int
);
create index test_f01 on test computed by (f01)
where f01 = 1 --------------------------------- [ ! ]
;

dyemanov added a commit that referenced this pull request Feb 17, 2023
… example in #7257). Better resource cleanup on error. Remove redundant ODS checks.
@dyemanov
Copy link
Copy Markdown
Member Author

@pavel-zotov Should be fixed now.

@pavel-zotov
Copy link
Copy Markdown

@@@ QA issue @@@
Currently this test contains only trivial cases for check.
More complex examples, including test of backup/restore, validation, using of misc datatypes (non-ascii, decfloat and int128), will be added later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants