Problem/Motivation
After upgrading Drupal core from 11.3.x to 11.4.x (tested on 11.4.2) with PHP 8.3 and sqlsrv 5.0.1, running drush updb or drush cr fails with errors in the database layer.
Errors observed:
1. TypeError:
Cannot access offset of type array in isset or empty in Connection::escapeField()
2. SQL Server error:
"The MERGE statement attempted to UPDATE or DELETE the same row more than once"
This occurs during key_value table writes, triggered during container rebuild or update operations.
Impact:
- drush cr fails
- drush updb fails
- System cannot bootstrap fully
This issue blocks usage of sqlsrv with Drupal 11.4.x.
Steps to reproduce
1. Install Drupal 11.3.x with sqlsrv module (5.0.1)
2. Upgrade Drupal to 11.4.x (e.g., 11.4.2)
3. Use PHP 8.3
4. Run:
drush updb
or
drush cr
5. Observe failure during key_value operations
Comments
Comment #2
cilefen commented#2547493: Add support for unique / primary key constraints composed of multiple fields for Upsert queries and #3586760: Use composite key Upsert queries in core changed how upset works.
Comment #3
prathamesh.save commentedThank you for identifying the root cause and linking the related Drupal core changes.
Since Drupal 11.4.x is now using composite-key Upsert queries, would it be possible for one of the SQLSRV module maintainers to make the necessary changes in the SQLSRV driver to support this new behavior?
Currently this issue blocks site load, drush cr and drush updb on Drupal 11.4.x installations using SQL Server, so any guidance, patch, or roadmap for compatibility would be greatly appreciated.
Thanks for your continued maintenance of the SQLSRV project.
Comment #4
benm2 commentedHi team. This issue has brought development on our site to a screeching halt. Would greatly appreciate somebody looking into this. I'm seriously considering switching my site over to MySQL.