Commit 9a3aeaf
committed
bug #62799 [Cache][HttpFoundation] Fix VARBINARY columns on sqlsrv (nicolas-grekas)
This PR was merged into the 6.4 branch.
Discussion
----------
[Cache][HttpFoundation] Fix VARBINARY columns on sqlsrv
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix #62241
| License | MIT
PdoSessionHandler was failing against SQL Azure when writing session data to a VARBINARY(MAX) column because the pdo_sqlsrv driver sent the data as nvarchar, which SQL Server cannot implicitly convert to varbinary(max).
This patch makes the sqlsrv driver use a stream resource for session data (like the existing oci handling), both for INSERT/UPDATE statements and the MERGE upsert path. This ensures the data is treated as binary and avoids the implicit conversion error, while keeping the existing schema (VARBINARY(MAX)) unchanged.
A new test (testSqlsrvDataBindingUsesStream) verifies that, for sqlsrv, the session data is bound as a PDO::PARAM_LOB resource when using the MERGE path.
Commits
-------
af745d4 [HttpFoundation][Cache] Fix VARBINARY columns on sqlsrvFile tree
3 files changed
+75
-3
lines changed- src/Symfony/Component
- Cache/Adapter
- HttpFoundation
- Session/Storage/Handler
- Tests/Session/Storage/Handler
3 files changed
+75
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
317 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
318 | 328 | | |
319 | 329 | | |
320 | 330 | | |
| |||
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
798 | 804 | | |
799 | 805 | | |
800 | 806 | | |
| |||
822 | 828 | | |
823 | 829 | | |
824 | 830 | | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
825 | 837 | | |
826 | 838 | | |
827 | 839 | | |
| |||
869 | 881 | | |
870 | 882 | | |
871 | 883 | | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
872 | 888 | | |
873 | 889 | | |
874 | | - | |
| 890 | + | |
875 | 891 | | |
876 | 892 | | |
877 | | - | |
| 893 | + | |
878 | 894 | | |
879 | 895 | | |
880 | 896 | | |
| |||
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
393 | 433 | | |
394 | 434 | | |
395 | 435 | | |
| |||
408 | 448 | | |
409 | 449 | | |
410 | 450 | | |
| 451 | + | |
411 | 452 | | |
412 | | - | |
| 453 | + | |
413 | 454 | | |
414 | 455 | | |
415 | 456 | | |
| 457 | + | |
416 | 458 | | |
417 | 459 | | |
418 | 460 | | |
| |||
425 | 467 | | |
426 | 468 | | |
427 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
428 | 474 | | |
429 | 475 | | |
430 | 476 | | |
| |||
0 commit comments