Fix MySQL protocol on error

This commit is contained in:
Nikolay Degterinsky 2023-11-16 07:23:45 +00:00
parent 648e0bd4cb
commit ed0829628b

View File

@ -141,7 +141,7 @@ void MySQLHandler::run()
catch (const Exception & exc)
{
log->log(exc);
packet_endpoint->sendPacket(ERRPacket(exc.code(), "00000", exc.message()), true);
packet_endpoint->sendPacket(ERRPacket(exc.code(), "HY000", exc.message()), true);
}
OKPacket ok_packet(0, handshake_response.capability_flags, 0, 0, 0);
@ -205,7 +205,7 @@ void MySQLHandler::run()
catch (...)
{
tryLogCurrentException(log, "MySQLHandler: Cannot read packet: ");
packet_endpoint->sendPacket(ERRPacket(getCurrentExceptionCode(), "00000", getCurrentExceptionMessage(false)), true);
packet_endpoint->sendPacket(ERRPacket(getCurrentExceptionCode(), "HY000", getCurrentExceptionMessage(false)), true);
}
}
}
@ -279,7 +279,7 @@ void MySQLHandler::authenticate(const String & user_name, const String & auth_pl
catch (const Exception & exc)
{
LOG_ERROR(log, "Authentication for user {} failed.", user_name);
packet_endpoint->sendPacket(ERRPacket(exc.code(), "00000", exc.message()), true);
packet_endpoint->sendPacket(ERRPacket(exc.code(), "HY000", exc.message()), true);
throw;
}
LOG_DEBUG(log, "Authentication for user {} succeeded.", user_name);