From eb5971bb1268c4325767146606751f7b1426d7fb Mon Sep 17 00:00:00 2001 From: Savorboard Date: Sat, 30 Sep 2017 22:48:30 +0800 Subject: [PATCH] fix mysql sql bug. --- src/DotNetCore.CAP.MySql/MySqlMonitoringApi.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DotNetCore.CAP.MySql/MySqlMonitoringApi.cs b/src/DotNetCore.CAP.MySql/MySqlMonitoringApi.cs index 8b8e3c9..49fd270 100644 --- a/src/DotNetCore.CAP.MySql/MySqlMonitoringApi.cs +++ b/src/DotNetCore.CAP.MySql/MySqlMonitoringApi.cs @@ -83,7 +83,7 @@ select count(Id) from `{0}.received` where StatusName in (N'Processing',N'Sched where += " and Content like '%@Content%'"; var sqlQuery = - $"select * from `{_prefix}.{tableName}` where 1=1 {where} order by Added desc limit limit @Limit offset @Offset"; + $"select * from `{_prefix}.{tableName}` where 1=1 {where} order by Added desc limit @Limit offset @Offset"; return UseConnection(conn => conn.Query(sqlQuery, new { @@ -129,8 +129,8 @@ select count(Id) from `{0}.received` where StatusName in (N'Processing',N'Sched private int GetNumberOfMessage(IDbConnection connection, string tableName, string statusName) { var sqlQuery = statusName == StatusName.Processing - ? $"select count(Id) from `{_prefix}].{tableName}` where StatusName in (N'Processing',N'Scheduled',N'Enqueued')" - : $"select count(Id) from `{_prefix}].{tableName}` where StatusName = @state"; + ? $"select count(Id) from `{_prefix}.{tableName}` where StatusName in (N'Processing',N'Scheduled',N'Enqueued')" + : $"select count(Id) from `{_prefix}.{tableName}` where StatusName = @state"; var count = connection.ExecuteScalar(sqlQuery, new {state = statusName}); return count;