-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
PostgreSQL: Floating point value in scientific notation with trailing zero gets changed #307
Comments
dg
added a commit
that referenced
this issue
Aug 9, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
You're probably right that it can be simplified. I just need to leave the fix for SQL Server, which returns decimal numbers like |
dg
added a commit
that referenced
this issue
Aug 13, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 15, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 17, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 18, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
dg
added a commit
that referenced
this issue
Aug 19, 2024
The only thing left is to check if the string does not start with a period, because of SQLserver - 0c2ebef - #289 - https://learn.microsoft.com/cs-cz/sql/connect/php/formatting-decimals-pdo-sqlsrv-driver?view=sql-server-2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: 3.2, 3.1.7, 3.1, ...
Bug Description
Row normalizer changes value of floating point value in scientific notation (e.g. 1E-10) with exponent that ends with zeroes. This is only done when PDO driver returns floating point value as
string
(PostgreSQL) and not asfloat
(MySQL and SQLite3).Steps To Reproduce
Can be reproduced by adding this code to
ResultSet.normalizeRow.postgre.phpt
.It fails with:
Database returns value as
'1.2E-10'
but row normalizer changes value to'1.2E-1'
by removing trailing zeroes.Problem is caused by first block of handling float and decimal values (from
v3.2
):Expected Behavior
Floating point values shouldn't be changed.
Possible Solution
Before 3.1.5 there was code that returns numeric values that are not possible to represent as floating point as string (if I understand correctly) but that was removed in order to fix #289. In result I see no point of having that code because PHP's cast operator can handle conversion and floating point and decimal values are never returned as string after 3.1.5.
The text was updated successfully, but these errors were encountered: