-
Notifications
You must be signed in to change notification settings - Fork 374
Closed
Description
To reproduce:
- Connect with ColumnEncryption = Enabled
- Create an integer column with encryption (doesn't matter whether it's deterministic / randomized)
- Insert -2147483647 into this table
- Create a stored procedure to return this value as an OUTPUT parameter
- Call this stored procedure to retrieve this as a string (PDO::PARAM_STR) with length = 2048
- Error message "SQLSTATE[22003]: [Microsoft][ODBC Driver 17 for SQL Server]Numeric value out of range"
With AE, the integer column size is 10, and the buffer size required for "-2147483647" is 11.
This applies to negative decimals / numerics as well, using either SQLSRV or PDO_SQLSRV.
For example, if a column is of type decimal(4, 0), and the input is -9223.3720368548, the output param value is '-922'.
With SQLSRV, this might result in the error: "[Microsoft][ODBC Driver 17 for SQL Server]String data, right truncation"
See the new tests
sqlsrv_ae_output_param_sqltype_decimal_precision.phpt
sqlsrv_ae_output_param_sqltype_numeric.phpt
pdo_ae_output_param_integers.phpt
pdo_ae_output_param_decimals.phpt
for more examples.