-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
[FB5] SUM() breaks query for BIGINT columns and arithmetic operations #8137
Comments
Firebird 4 and later return
TIMESTAMP WITH TIME ZONE also seems to be unsupported (which is also true in php-firebird). |
@janzikmund , firebird.connf : DataTypeCompatibility = 3.0 might help. |
Thanks so much, I can confirm both ways above fix the problem. @hmoffatt - you probably meant "..return INT128 for SUM", correct? Then it makes complete sense. But do you assume this might be fixed with future versions of fdb/php-firebird? I understand they both depend on libfbclient.so , but even latest stable version gives this error, so not sure if it's any related. What I am after is- will we be able to use SUM() reliably with default settings, or is it assumed we will need this returned type override or be locked in DataTypeCompatibility mode? |
According to change log the driver supports int128 staring from version 0.7.0. |
|
php-firebird has an open issue FirebirdSQL/php-firebird#58 ; development seems to be stalled though, timezone support is also missing FirebirdSQL/php-firebird#26 . I also use Qt which is also missing INT128 support across all platforms, so I just add the 'set bind' to my connect string. I don't see how to do that in Python with fdb though. |
@aafemt , @dyemanov : Nice, that takes care of it for Python, then 👍 As for PHP, it also has this ticket, so hopefully it will get there as well: Thanks so much for all help |
Closing. |
I think it requires at least Firebird 3, doesn't it? Can I still talk to 2.5 servers, as long as I use a recent fbclient library? |
On 5/28/24 13:58, Hamish Moffatt wrote:
Can I still talk to 2.5 servers, as long as I use a recent fbclient
library
Yes.
|
Firebird version: 5.0.0 in Docker container
When connecting from Python, PDO or php_interbase, an error is thrown when:
1. SUM() column contains arithmetic operation, eg.
SELECT SUM(1+1) FROM RDB$DATABASE
Expected result: 2
Result: Error (from Python script):
fdb.fbcore.DatabaseError: ('Cursor.fetchone:\n- SQLCODE: -804\n- Incorrect values within SQLDA structure\n- empty pointer to data\n- at SQLVAR index 0', -804, 335544713)
2. SUM() is run on BIGINT column type
Example using demo employee database:
Expected result: (int) number of rows in table
Result: Error
fdb.fbcore.DatabaseError: ('Cursor.fetchone:\n- SQLCODE: -804\n- Incorrect values within SQLDA structure\n- empty pointer to data\n- at SQLVAR index 0', -804, 335544713)
For a reference, below is the Python3 script I am testing with:
The text was updated successfully, but these errors were encountered: