v.20.9Improvement

MySQL Handler Returns OK for Ignored SET Statements After Handshake

MySQL handler returns OK for queries like SET @@var = value. Such statement is ignored. It is needed because some MySQL drivers send SET @@ query for setup after handshake https://github.com/ClickHouse/ClickHouse/issues/9336#issuecomment-686222422 . #14469 (BohuTANG).
The MySQL handler in ClickHouse now returns OK for SET @@var = value queries, effectively ignoring these statements.

Why it matters

Some MySQL drivers send SET @@ queries to configure session variables after the handshake. Previously, these queries could cause issues since ClickHouse did not handle them properly. This feature ensures compatibility with such MySQL clients by silently accepting and ignoring these configuration statements, improving interoperability.

How to use it

No explicit user action is required to enable this behavior. When using the MySQL protocol handler in ClickHouse, queries like SET @@var = value will automatically return OK without affecting query execution.