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

AE - fetching decimals / numerics as output parameters bound to PDO::PARAM_BOOL or PDO::PARAM_INT returns floats, not integers #707

Closed
yitam opened this issue Mar 7, 2018 · 1 comment

Comments

@yitam
Copy link
Contributor

yitam commented Mar 7, 2018

To reproduce,

  1. connect with ColumnEncryption enabled (AE on)
  2. create a table with one decimal column (or numeric )
  3. insert one row of valid data
  4. write a stored procedure to fetch the value of this decimal column as output parameter
  5. use prepare() to call this stored procedure
  6. bind this output parameter to PDO::PARAM_INT or PDO::PARAM_BOOL
  7. after execute(), the output param is a float, not integer as expected

For example, a table is created with a decimal(4, 1) column,
if the input is 922.337, the data fetched as output param is 922.3, or
if the input is -922.337, the data fetched as output param is -922.3

If binding the variable as an inout parameter with type PDO::PARAM_INT, and the variable is initialized to an integer, then this problem goes away.

Without AE, given the same inputs above, the output params are 922 and -922 respectively with type PDO::PARAM_INT, or bool(true) / bool(false) as with type PDO::PARAM_BOOL

@yitam yitam changed the title AE - fetching decimals / numerics are output parameters bound to PDO::PARAM_BOOL or PDO::PARAM_INT returns floats, not integers AE - fetching decimals / numerics as output parameters bound to PDO::PARAM_BOOL or PDO::PARAM_INT returns floats, not integers Mar 7, 2018
@yitam
Copy link
Contributor Author

yitam commented May 30, 2018

Fixed in 5.2.1-preview.

@yitam yitam closed this as completed May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant