FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.22k stars 213 forks source link

The legacy plan with window functions is broken. #7698

Closed sim1984 closed 12 months ago

sim1984 commented 12 months ago
SQL> show version;
ISQL Version: WI-T5.0.0.1150 Firebird 5.0 Beta 2
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-T5.0.0.1150 Firebird 5.0 Beta 2"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-T5.0.0.1150 Firebird 5.0 Beta 2/tcp (station9)/P18:C"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-T5.0.0.1150 Firebird 5.0 Beta 2/tcp (station9)/P18:C"
on disk structure version 13.1
SQL> set plan on;
SQL> set planonly;
SQL> select count(*) over() from rdb$relations;

PLAN
    -> Window
        -> Window BufferRDB$RELATIONS NATURAL
mrotteveel commented 12 months ago

Please be explicit and describe/point out what is broken and what you expect instead. I guess the lack of a space between Buffer and RDB$RELATIONS, but that is just my guess, and maybe it should be something else entirely.

sim1984 commented 12 months ago

Legacy plan is a plan that can be substituted into the query PLAN expression and the query will continue to work. There are no sublevels in the Legacy plan. For comparison, how this plan is displayed in 4.0:

PLAN (RDB$RELATIONS NATURAL)
mrotteveel commented 12 months ago

See, this is why you need to explicitly point out the problem ;)

sim1984 commented 12 months ago

This is a small regression introduced by a recent commit https://github.com/FirebirdSQL/firebird/commit/affddfa9c5b9069e8e2e49d0c415c7e5ea620474