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
Legacy configuration to COUNT return an INTEGER instead of BIGINT [CORE6259] #6501
Comments
Commented by: @aafemt No new features in stable branches, please. |
Commented by: @asfernandes What impact the data type change caused? |
Commented by: @livius2 Adriano, |
Modified by: Beto Neto (betoneto.tbo)issuetype: New Feature [ 2 ] => Improvement [ 4 ] |
Commented by: @asfernandes This is a problem with the component library. Libraries may be designed such as this type of problem could not happen. |
Commented by: Beto Neto (betoneto.tbo) "This is a problem with the component library." I do not agree, this is a broke of backward compatibility, as I say, in my vision firebird could have an configuration property to maintain the old behavior (count returning as integer). The component library maps the types correctly, it was a Integer and now is a Int64 (bingint). |
Commented by: Sean Leyne (seanleyne) I am inclined to agree Beto, however, one question... What database dialect are you using? 1 or 3? |
Commented by: @asfernandes The mapped type may still work when the type is changed if the component library / application is well coded thinking in maintainability. |
Commented by: @livius2 Adriano this is not library problem, this is developer choice. |
Commented by: @asfernandes If this is "this is developer choice" then in this choice must be the desire to update the code when Firebird improve things, instead of wanting Firebird to create such type of config to support bad developer choices. This ticket should be closed as won't fix IMO. |
Commented by: Beto Neto (betoneto.tbo) "to support bad developer choices" ? This is the API of Delphi (in this case), if I must not use it features (add TFields to dataset) just to prevent "firebird improvements" incompatibilities, I don't know for what they have been created. For me this is the same case of the other improvements over the security, where we can set the legacy behavior: AuthServer = Legacy_Auth |
Commented by: Beto Neto (betoneto.tbo) The real problem here is that the Delphi 7 doesn't handle BIGINT (int64) types. Even the dataset maps the field to a FMTBCD, when you try to get the value a overflow exception is thrown. So the only solution is cast all counts to integer or (please) implement this issue. |
Commented by: Sean Leyne (seanleyne) Beto, One more time... what database dialect are you using? |
Commented by: Beto Neto (betoneto.tbo) Dialect 3 |
Commented by: Sean Leyne (seanleyne) That is your problem! The "Legacy Support" relates to functional changes which the project has made to the Firebird v1.0 functionality (after which the project takes responsibility). Dialect 3 has always returned COUNT() as BIGINTs, a feature implementation of Interbase v5.5 which pre-dates the Firebird project. Either; IMO, your problem is not the Firebird project's to resolve (as Adriano and Karol have commented). |
Modified by: Sean Leyne (seanleyne)status: Open [ 1 ] => Resolved [ 5 ] resolution: Won't Fix [ 2 ] |
Commented by: @dyemanov Sean, you're wrong. Historically, COUNT was always returning INTEGER. |
Commented by: Sean Leyne (seanleyne) OK, sorry. But does that change how we will handle this ticket? |
Commented by: @dyemanov We had discussed that at the last conference in Berlin. Some people complain and I agree that could be a PITA. Basically, this might be the only significant showstopper for migration to FB3. But the change was obviously done for purpose, tables and cursors with more than 2^31 records in not a science fiction these days. In the past, we used to add backward compatibility config options under users' pressure, but amount of affected users should be noticable for that. So far I don't see us hitting that point. Delphi 7 with no BIGINT support is not an argument at all. It was released 18 years ago, so why should we care? Moreover, users may always skip FB3 and wait for FB4 with its SET BIND feature. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Beto Neto (betoneto.tbo)
Votes: 3
The new version of Firebird 3 causes a lot of impacts on legacy applications with the COUNT function.
A very useful feature would be, if it existed an configuration to rollback the return type of COUNT from BIGINT to INTEGER.
I know that exists workarrounds like "CAST(count(*) as INTEGER)" but the work to add an CAST to all COUNTs can be very expensive. The simple way could be just "ativate" a backward compatibility property in firebird.conf like the 'AuthClient = Legacy_Auth'.
The text was updated successfully, but these errors were encountered: