Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error log: Failed to execute query: select $$ #2514

Closed
evenyag opened this issue Sep 27, 2023 · 4 comments · Fixed by #2896
Closed

error log: Failed to execute query: select $$ #2514

evenyag opened this issue Sep 27, 2023 · 4 comments · Fixed by #2896
Labels
C-bug Category Bugs good first issue Good for newcomers

Comments

@evenyag
Copy link
Contributor

evenyag commented Sep 27, 2023

What type of bug is this?

Other

What subsystems are affected?

Standalone mode, Frontend

What happened?

The server will print an error log while using MySQL client to connect to it.

What operating system did you use?

macOS

Relevant log output and stack trace

Failed to execute query: select $$ trace_id=7112803851606036243 err.msg=0: Table operation error, at src/frontend/src/instance.rs:424:14
1: Failed to plan statement, at /src/operator/src/statement.rs:200:14
2: Cannot plan SQL: SELECT $$, at src/query/src/planner.rs:79:60
3: SchemaError(FieldNotFound { field: Column { relation: None, name: "$$" }, valid_fields: [] }) err.code=PlanQuery

How can we reproduce the bug?

  1. starts the server
  2. execute mysql -h 127.0.0.1 -P 4002
@evenyag evenyag added the C-bug Category Bugs label Sep 27, 2023
@waynexia
Copy link
Member

Can't reproduce it with the latest commit

2023-09-28T07:04:50.165559Z  INFO frontend::server: Starting GRPC_SERVER at 127.0.0.1:4001
2023-09-28T07:04:50.165639Z  INFO servers::grpc: gRPC server is bound to 127.0.0.1:4001
2023-09-28T07:04:50.171849Z  INFO frontend::server: Starting POSTGRES_SERVER at 127.0.0.1:4003
2023-09-28T07:04:50.171946Z  INFO servers::server: Postgres server started at 127.0.0.1:4003
2023-09-28T07:04:50.171990Z  INFO frontend::server: Starting HTTP_SERVER at 127.0.0.1:4000
2023-09-28T07:04:50.263047Z  INFO servers::http: HTTP server is bound to 127.0.0.1:4000
2023-09-28T07:04:50.263106Z  INFO frontend::server: Starting MYSQL_SERVER at 127.0.0.1:4002
2023-09-28T07:04:50.263145Z  INFO servers::server: MySQL server started at 127.0.0.1:4002
2023-09-28T07:04:50.263190Z  INFO frontend::server: Starting OPENTSDB_SERVER at 127.0.0.1:4242
2023-09-28T07:04:50.263218Z  INFO servers::server: OpenTSDB server started at 127.0.0.1:4242
2023-09-28T07:05:19.592541Z  INFO servers::mysql::server: MySQL connection coming from: 127.0.0.1:47966
2023-09-28T07:05:19.594468Z  INFO common_telemetry: initializing bucket with node_id: 0

What's your mysql version? Mine is mysql from 11.1.2-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1

@evenyag
Copy link
Contributor Author

evenyag commented Sep 29, 2023

Reproduce with commit 201acd

greptimedb
branch: develop
commit: 201acd152db2a961d804b367e23d2224b4397de8
dirty: false
version: 0.4.0-nightly

mysql client version

$ mysql --version
mysql  Ver 8.1.0 for macos12.6 on arm64 (Homebrew)

@MichaelScofield MichaelScofield added the good first issue Good for newcomers label Nov 23, 2023
@MichaelScofield
Copy link
Collaborator

We could simply add a regex rule in federated.rs for this select $$ pattern.

@tisonkun
Copy link
Collaborator

tisonkun commented Dec 9, 2023

I met this issue also and here is a patch #2896. However, I notice that our regex group solution is a bit brittle since it match exactly specially with spaces. But since it's mainly to workaround MySQL tools, this may be OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants