DB_KEY is always zero for external tables [CORE2796] #3186
Labels
affect-version: 1.5.4
affect-version: 1.5.5
affect-version: 1.5.6
affect-version: 2.0.0
affect-version: 2.0.1
affect-version: 2.0.2
affect-version: 2.0.3
affect-version: 2.0.4
affect-version: 2.0.5
affect-version: 2.1.0
affect-version: 2.1.1
affect-version: 2.1.2
affect-version: 2.1.3
affect-version: 2.5 Alpha 1
affect-version: 2.5 Beta 1
affect-version: 2.5 Beta 2
affect-version: 3.0 Initial
component: engine
fix-version: 3.0 Alpha 1
priority: minor
qa: done successfully
type: bug
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;
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
The text was updated successfully, but these errors were encountered: