mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Fix MySQL protocol on error
This commit is contained in:
parent
648e0bd4cb
commit
ed0829628b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user