Skip to content

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

@yitam

Description

@yitam

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions