Skip to content

#8056: Adapting MySqlCommandInterpreter to 767 character length limitation#8826

Merged
BenedekFarkas merged 4 commits intoOrchardCMS:devfrom
mazuryv:patch-1
Oct 17, 2025
Merged

#8056: Adapting MySqlCommandInterpreter to 767 character length limitation#8826
BenedekFarkas merged 4 commits intoOrchardCMS:devfrom
mazuryv:patch-1

Conversation

@mazuryv
Copy link
Contributor

@mazuryv mazuryv commented Jan 21, 2025

#8056
767 length limitation in mysql

OrchardCMS#8056
767 length limitation in mysql
@sebastienros
Copy link
Member

LGTM. But needs @BenedekFarkas and @MatteoPiovanelli

@mazuryv
Copy link
Contributor Author

mazuryv commented Jan 27, 2025

Without these changes recipe was fallen for me in Orchard.Recipes.Migrations
table.CreateIndex("IDX_RecStResRec_ExecId_StepN", "ExecutionId", "StepName");
MySqlServer 8.0.40/8.0.41

@sebastienros
Copy link
Member

LGTM but someone should validate it too. Or add a functional test.

@BenedekFarkas
Copy link
Member

LGTM but someone should validate it too. Or add a functional test.

I'll test it locally.

@BenedekFarkas
Copy link
Member

I'm trying to test this, but having problems completing the setup with a MySQL version (5.7.44) that is supposed to be compatible with the MySQL connector we're using (6.7.9).

Docker:

Run: docker run --name mysql -p 3307:3306 -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=Orchard -d mysql:5.7.44
Connection string: Server=localhost;Port=3307;Database=Orchard;Uid=root;Pwd=password;SslMode=None

Local server:

Connection string: Server=localhost;Port=3306;Database=orchard;Uid=root;Pwd=password;SslMode=None

Error (same for both):

MySql.Data.MySqlClient.MySqlException: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(NOLOCK) inner join Title_TitlePartRecord titlepartr2_ WITH(NOLOCK) on this_.Id=' at line 1'

Docker images with more recent versions have different errors.

@mazuryv what version of MySQL are you using? Did you experience any similar errors?

@mazuryv
Copy link
Contributor Author

mazuryv commented Apr 4, 2025

Hello.
I have updated MySQL connector MySql.Data nuget package up to 9.2.0 to be compatible with current MySqlServer 8.0.40/8.0.41+
Thank you.

@BenedekFarkas
Copy link
Member

OK, that's a pretty important detail. :)

Are there any other changes to your code/application that isn't in the PR branch? I can't get the setup to complete unless NoLockInterceptor is "neutralized" by not modifying the SQL statement.

@BenedekFarkas BenedekFarkas changed the title Update MySqlCommandInterpreter.cs Adapting MySqlCommandInterpreter to 767 character length limitation Jun 5, 2025
@BenedekFarkas
Copy link
Member

BenedekFarkas commented Jun 5, 2025

We need additional verification from someone who already uses MySQL to make sure we don't break existing applications + I still can't get the setup to work in this state, so any additional testing and extra set of eyes are welcome.

@BenedekFarkas BenedekFarkas changed the title Adapting MySqlCommandInterpreter to 767 character length limitation #8506: Adapting MySqlCommandInterpreter to 767 character length limitation Oct 17, 2025
@BenedekFarkas
Copy link
Member

I managed to test this and verify that the changes work, however, only if:

I'll look into upgrading MySql.Data in #8859.

@BenedekFarkas BenedekFarkas merged commit c10168a into OrchardCMS:dev Oct 17, 2025
4 of 5 checks passed
@BenedekFarkas BenedekFarkas changed the title #8506: Adapting MySqlCommandInterpreter to 767 character length limitation #8056: Adapting MySqlCommandInterpreter to 767 character length limitation Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants