FirebirdSQL / firebird

Firebird server, client and tools
https://firebirdsql.org
1.26k stars 217 forks source link

Indentation must be seen between Refetch and subsequent Sort (FB 6.x+) #8235

Closed pavel-zotov closed 2 months ago

pavel-zotov commented 2 months ago
set bail on;
set list on;
shell del r:\temp\tmp4test.fdb 2>nul;
create database 'localhost:r:\temp\tmp4test.fdb';
commit;

recreate table test(
    id int
    ,f01 int
    ,f02 int
    ,txt_short varchar(998)
    ,txt_broad varchar(999)
);
commit;

set explain on;
select txt_broad from test a02 order by id;

Output in FB 4.x and 5.x:

Select Expression
....-> Refetch
........-> Sort (record length: 28, key length: 8)
............-> Table "TEST" as "A02" Full Scan

Output in FB 6.x:

Select Expression
....-> Refetch
....-> Sort (record length: 28, key length: 8)
............-> Table "TEST" as "A02" Full Scan
pavel-zotov commented 2 months ago

The issues is covered by tests for #8225 and #3057 (CORE-2650)