@@ -510,12 +510,17 @@ struct pdo_dbh_methods pdo_sqlsrv_dbh_methods = {
510
510
pdo_sqlsrv_dbh_last_id,
511
511
pdo_sqlsrv_dbh_return_error,
512
512
pdo_sqlsrv_dbh_get_attr,
513
- NULL , // check liveness not implemented
513
+ NULL , // check liveness not implemented
514
514
pdo_sqlsrv_get_driver_methods,
515
- NULL , // request shutdown not implemented
516
- NULL // in transaction not implemented
515
+ NULL , // request shutdown not implemented
516
+ #if PHP_VERSION_ID < 80100
517
+ NULL // in transaction not implemented
517
518
};
518
-
519
+ #else
520
+ NULL , // in transaction not implemented
521
+ NULL // get_gc not implemented
522
+ };
523
+ #endif
519
524
520
525
// log a function entry point
521
526
#define PDO_LOG_DBH_ENTRY \
@@ -1723,7 +1728,8 @@ zend_string* pdo_sqlsrv_dbh_quote(_Inout_ pdo_dbh_t* dbh, _In_ const zend_string
1723
1728
// On failure, a negative number is returned
1724
1729
// The generated string has a length of at most len - 1, so
1725
1730
// len is 3 (2 hex digits + 1)
1726
- int n = snprintf ((char *)(*quoted + pos), 3 , " %02X" , unquoted[index ]);
1731
+ // Requires "& 0x000000FF", or snprintf will translate "0x90" to "0xFFFFFF90"
1732
+ int n = snprintf ((char *)(*quoted + pos), 3 , " %02X" , unquoted[index ] & 0x000000FF );
1727
1733
if (n < 0 ) {
1728
1734
// Something went wrong, simply return 0 (failure)
1729
1735
return 0 ;
0 commit comments