FreeTDS / freetds

Official FreeTDS repository
http://www.freetds.org/
GNU General Public License v2.0
460 stars 158 forks source link

PDO::PARAM_INT is not working #445

Open Malborito opened 2 years ago

Malborito commented 2 years ago

During the Drupal 8 to 9 update proccess, server's php version 7.2 has been updated to 7.4

The stored procedures in mssql are not working anymore, after some workaround we've detected that fails only on the stored procedures with "\PDO::PARAM_INT" receiving the following error:

"PDOException: SQLSTATE[HY090]: Invalid string or buffer length: 0 [FreeTDS][SQL Server]Invalid string or buffer length (SQLExecute[0] at /builddir/build/BUILD/php-7.4.26/ext/pdo_odbc/odbc_stmt.c:259) in ...."

We've tested diferent versions of FreeTDS acording the guide https://www.freetds.org/userguide/ChoosingTdsProtocol.html We've replaced every \PDO::PARAM_INT to \PDO::PARAM_STR

We think is not the correct way to solve the error, Is there any wellknown error or solution.

fziglio commented 2 years ago

You should try to enable ODBC loggings and see why the length is invalid. It's not dependent on TDS protocol version. Did you upgrade only PHP or also FreeTDS?