Skip to content
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

[release/5.0] SqlServer Migrations: Don't generate EXEC(CONCAT()) #23005

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Oct 15, 2020

Fixes #22611

Description

In 5.0 we started generating EXEC calls in idempotent migration SQL scripts to work around quirks in the SQL Server parser. Unfortunately, this code didn't integrate well with another change we made to generate CONCAT calls for string literals containing new lines. The resulting SQL--EXEC(CONCAT(...))--is invalid.

Customer Impact

This will only affect users generating idempotent migration scripts containing seed data. One customer has reported it so far.

How found

Customer reported on RC2.

Test coverage

We have tests comparing the generated SQL against a baseline. However, we don't have any tests that execute the SQL scripts due to the complexity of executing scripts containing utility statements like GO that aren't supported by SqlClient and only work in tools like SSMS, SDT, and SQLCMD. We previously failed to manually verify that the scripts executed correctly. This verification has now been done for the current baselines.

Regression?

Yes, for certain scenarios from 3.1. Although some scripts would have failed in 3.1 because of the missing EXEC calls, others would have worked that are now broken in 5.0.

cc @Pilchie

@bricelam bricelam requested a review from a team October 15, 2020 17:35
@Pilchie
Copy link
Member

Pilchie commented Oct 15, 2020

Approved (by email) for 5.0 GA.

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.

3 participants