Skip to content

[Messenger] Fix mssql compatibility for doctrine transport. #39166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2020

Conversation

thsmrtone1
Copy link

Add logic for locking row for update when the doctrine dbal connection is sqlsrv. This is a quick and dirty solution, but it prevents the need to rewrite the logic due to doctrine dbal limitations.

See issue #39117

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #39117
License MIT
Doc PR

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@derrabus
Copy link
Member

This PR looks like it fixes the problem. Can you try to cover your changes with a test?

@thsmrtone1
Copy link
Author

Can you try to cover your changes with a test?

@derrabus I'm afraid this may be a bit beyond my capability.

@derrabus
Copy link
Member

derrabus commented Nov 25, 2020

This PR looks like it fixes the problem. Can you try to cover your changes with a test?

That's okay, I'll see if I can come up with a test.

Add logic for locking row for update when the doctrine dbal connection is sqlsrv. This is a quick and dirty solution, but it prevents the need to rewrite the logic due to doctrine dbal limitations.

See issue symfony#39117
@derrabus
Copy link
Member

Thank you @thsmrtone1.

@derrabus derrabus merged commit 42061de into symfony:4.4 Nov 28, 2020
@derrabus
Copy link
Member

I've added a test in #39214.

This was referenced Nov 29, 2020
derrabus added a commit that referenced this pull request Dec 5, 2020
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Test generated SQL

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

Follow-up to #39166.

This is an attempt to the SQL generated by the `Symfony\Component\Messenger\Transport\Doctrine\Connection::get()` method. The challange was to create a locking SELECT statement, taking into account the different ways to create a lock in different SQL dialects.

This test verifies if the correct lock statements are generated for MySQL and SQL Server.

Commits
-------

1f1b62a [Messenger] Test generated SQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants