Skip to content

Ignore 'select $$' in query log #19610

@DenWav

Description

@DenWav

Feature Description

Since MySQL 8.4 the mysql command (mysql-client) fires a select $$ as part of the connection process after asking for the server version. manticoresearch ran into the same problem: manticoresoftware/manticoresearch#2772

manticoresearch's solution is to ignore it in the query log: manticoresoftware/manticoresearch@0a481dd

I think this is appropriate since it appears hardcoded in newer clients for some reason (tested Oracle MySQL client and the Percona fork, same result).

Here is the commit that adds this to the MySQL client: mysql/mysql-server@9c7bc29
Link to code: https://github.com/mysql/mysql-server/blob/447eb26e094b444a88c532028647e48228c3c04f/client/mysql.cc#L1288-L1292

The client is just using it to check if $$ is supported as quotes.

Use Case(s)

For integration load testing I have scripts that spin up a lot of parallel connections to the database, and every time a mysql client initiates a new connection to the server I get a log message in the vtgate log about the invalid query. As it's a hard-coded query that is meaningless (as far as I can tell) and completely out of my control, that is just unnecessary noise in the query log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions