Skip to content
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

OracleDriver method applyLimit converts integer values to float #345

Open
BigOHenry opened this issue Nov 19, 2019 · 1 comment
Open

OracleDriver method applyLimit converts integer values to float #345

BigOHenry opened this issue Nov 19, 2019 · 1 comment

Comments

@BigOHenry
Copy link

Version: 4.1.0

Bug Description

OracleDriver method applyLimit converts integer values (1) to float values (1.0). Even count.

Steps To Reproduce

On Oracle at any DibiFluent call ->limit(1). After that, all integer values becomes float.

@BigOHenry
Copy link
Author

BigOHenry commented Jan 3, 2020

I tried more testing and there is a bug, when you call on fluent limit() and count().

$this->db->select('*')
->from('table')
->limit(1)
->count();

Got this error:
Expected number, '7' given.

bdump from class Dibi\Result method normalize(). Dumps are before and after normalization.
obrazek

EDIT:

When there is a limit(), nativetype of column is NUMBER (normalized by dibi as float), if there isnt, nativetype of column is INTEGER (normalized by dibi as int).

EDIT2:
\Dibi\Drivers\OracleResult::getResultColumns (row::91). Problem is functionoci_field_scale. When there is limit() call on Fluent, value is -127, when it isnt, value is 0.

EDIT3:
https://www.php.net/manual/en/function.oci-field-scale.php#122650

There is a explemantion of that problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant