dibi icon indicating copy to clipboard operation
dibi copied to clipboard

OracleDriver method applyLimit converts integer values to float

Open BigOHenry opened this issue 6 years ago • 1 comments

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 avatar Nov 19 '19 15:11 BigOHenry

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.

BigOHenry avatar Jan 03 '20 14:01 BigOHenry