MySQLHandler: max_allowed_packet returned by default when server setup with select variables

This commit is contained in:
BohuTANG
2020-04-12 13:37:39 +08:00
parent b888c867b3
commit e7f399f652
3 changed files with 10 additions and 7 deletions
+4 -2
View File
@@ -284,15 +284,17 @@ void MySQLHandler::comQuery(ReadBuffer & payload)
}
else
{
String replacement_query = "select ''";
String replacement_query = "SELECT ''";
bool should_replace = false;
bool with_output = false;
// Translate query from MySQL to ClickHouse.
// This is a temporary workaround until ClickHouse supports the syntax "@@var_name".
// Required parameters when setup:
// * max_allowed_packet, default 64MB, https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_allowed_packet
if (isFederatedServerSetupSelectVarCommand(query))
{
should_replace = true;
replacement_query = "SELECT 67108864 AS max_allowed_packet";
}
// This is a workaround in order to support adding ClickHouse to MySQL using federated server.