Skip to content

Commit

Permalink
Don't cache MySQL errors on duplicate keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrossley committed Aug 28, 2022
1 parent b8acc09 commit 963d21d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions CumulusMX/Cumulus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10335,17 +10335,18 @@ public void MySqlCommandSync(ConcurrentQueue<string> Cmds, string CallingFunctio

internal void MySqlCommandErrorHandler(string CallingFunction, int ErrorCode, ConcurrentQueue<string> Cmds)
{
var ignore = ErrorCode == (int) MySqlConnector.MySqlErrorCode.ParseError ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.EmptyQuery ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.TooBigSelect ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.InvalidUseOfNull ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.MixOfGroupFunctionAndFields ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.SyntaxError ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.TooLongString ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.WrongColumnName ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.DuplicateUnique ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.PrimaryCannotHaveNull ||
ErrorCode == (int) MySqlConnector.MySqlErrorCode.DivisionByZero;
var ignore = ErrorCode == (int) MySqlErrorCode.ParseError ||
ErrorCode == (int) MySqlErrorCode.EmptyQuery ||
ErrorCode == (int) MySqlErrorCode.TooBigSelect ||
ErrorCode == (int) MySqlErrorCode.InvalidUseOfNull ||
ErrorCode == (int) MySqlErrorCode.MixOfGroupFunctionAndFields ||
ErrorCode == (int) MySqlErrorCode.SyntaxError ||
ErrorCode == (int) MySqlErrorCode.TooLongString ||
ErrorCode == (int) MySqlErrorCode.WrongColumnName ||
ErrorCode == (int) MySqlErrorCode.DuplicateUnique ||
ErrorCode == (int) MySqlErrorCode.PrimaryCannotHaveNull ||
ErrorCode == (int) MySqlErrorCode.DivisionByZero ||
ErrorCode == (int) MySqlErrorCode.DuplicateKeyEntry;

if (ignore)
{
Expand Down

0 comments on commit 963d21d

Please sign in to comment.