From 4cd46f829eba0521bce8c251f8e254837c50b3cd Mon Sep 17 00:00:00 2001 From: Oleg Zhuk Date: Wed, 1 Nov 2023 16:04:18 +0200 Subject: [PATCH] PT-14189: MySql error in your SQL syntax when open contract price fix: error in your SQL syntax when either open contract price or call GetMergedPrices on MySql --- .../Repositories/PricingRepositoryImpl.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/VirtoCommerce.PricingModule.Data/Repositories/PricingRepositoryImpl.cs b/src/VirtoCommerce.PricingModule.Data/Repositories/PricingRepositoryImpl.cs index b61180f5..2613ffc6 100644 --- a/src/VirtoCommerce.PricingModule.Data/Repositories/PricingRepositoryImpl.cs +++ b/src/VirtoCommerce.PricingModule.Data/Repositories/PricingRepositoryImpl.cs @@ -69,6 +69,12 @@ public Task DeletePricelistAssignmentsAsync(IEnumerable ids) public IQueryable GetMergedPrices(string basePriceListId, string priorityPriceListId) { var command = GetSearchMergedPricesCommand(basePriceListId, priorityPriceListId); + + if (DbContext.Database.ProviderName == "Pomelo.EntityFrameworkCore.MySql") + { + command.Text = command.Text.Replace("\"", ""); + } + var query = DbContext.Set().FromSqlRaw(command.Text, command.Parameters.ToArray()); return query; }