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

DB_KEY is always zero for external tables [CORE2796] #3186

Closed
firebird-automations opened this issue Jan 14, 2010 · 4 comments
Closed

DB_KEY is always zero for external tables [CORE2796] #3186

firebird-automations opened this issue Jan 14, 2010 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dyemanov

Historically, non-null DB_KEY was returned for VMS external tables as they could be indexed and also updated and deleted, so direct positioning was a requirement. For other external tables it was always a zero quad word. I don't consider it being a major problem, however it doesn't look absolutely correct:

create table t external file 'c:\ext.bin' (col int);
insert into t (col) values (1);
insert into t (col) values (2);
insert into t (col) values (3);

execute block returns (val int)
as
declare dbkey char(8) character set octets;
begin
select first 1 rdb$db_key from t into :dbkey;

for select col from t where rdb$db\_key = dbkey into :val do
  suspend;

end

This query returns you the whole table instead of the expected first row only. I don't think it would hurt anyone if we'd return a proper DB_KEY for external tables, just for the consistency sake. It could be either a monotonically increasing row number or an offset inside the external file.

Commits: 11495a5

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 3.0 Alpha 1 [ 10331 ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Done successfully

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