Replies: 5 comments 9 replies
-
cc @sundy-li Is there more suggestion? |
Beta Was this translation helpful? Give feedback.
-
MySQL also supported |
Beta Was this translation helpful? Give feedback.
-
Yep we support the step one now: root@mysqldb 22:27:00 [system]> select id, type, mysql_connection_id from processes;
+--------------------------------------+------------+---------------------+
| id | type | mysql_connection_id |
+--------------------------------------+------------+---------------------+
| eed18d69-dd8a-48b9-93e8-740e5ebf313c | Clickhouse | NULL |
| fd81b2ea-467d-4e78-a80e-666ef9d1809f | MySQL | 8 |
+--------------------------------------+------------+---------------------+
2 rows in set (0.05 sec)
Read 2 rows, 457.00 B in 0.004 sec., 495.93 rows/sec., 110.66 KiB/sec. |
Beta Was this translation helpful? Give feedback.
-
I try to create a new hashmap in session_mgr. The key is mysql conn id and the value is id. And the hashmap is force inserted in create_session. The code is here: TCeason@7a39bda#diff-05e190acf915432f50b78d25482d816df331623745159f6e235f255aa4c73516R190 But I think this will generate some other error. the kill query will also generate a new id so the hashmap will store the kill query's id as a new value. the query that we want to kill will not be killed. |
Beta Was this translation helpful? Give feedback.
-
root@mysqldb 17:19:03 [(none)]> select * from numbers(999999999);
^C^C -- query aborted
ERROR 1152 (08S01): Code: 1043, displayText = Aborted query, because the server is shutting down or the query was killed.
root@mysqldb 17:19:07 [(none)]> show tables;
Query OK, 0 rows affected (0.07 sec)
Read 22 rows, 2.61 KiB in 0.019 sec., 1.13 thousand rows/sec., 134.07 KiB/sec.
root@mysqldb 17:19:18 [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| INFORMATION_SCHEMA |
| default |
| system |
+--------------------+
3 rows in set (0.06 sec)
Read 3 rows, 63.00 B in 0.007 sec., 443.61 rows/sec., 9.10 KiB/sec.
It can make sense on my local pc. TCeason@cac7f4c But only have some question: I use the subsec_nanos as the mysql conn id . but it maybe not unique. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to ISSUE: #4871
Summary
When we press Ctrl + C on MySQL Client, the client will receive a kill signal.
And then generate a kill query like this :
kill query 8
Note: the
8
is a connection id, that can be select with function connection_id, and it is PROCESSLIST_ID in MySQL.How to fix
Support parser number
Now, we use parse_identifier to get the object_id in parser_kil. But the query like
kill quey 8
. So we need support parser numbers first.Support link MySQL connection id to query id
Now the kill query gets a query id and then uses get_session_by_id to get the session id. But now we can directly get the session id. And the plan.id is
String
but MySQL connection id is au32 int
.So I think we need do some convert to get the query id in analyze.
MySQL connection id need diff.
In mysql_interactive_worker we hard code MySQL connection set the value always be 8. If we support the second item, the MySQL connection id should be different.
Question
Now I just support parser number but store it as an ident with query quote
'
. In commit: TCeason@b32a663But I find the object_id is Ident, value is a string type, how can we let the object_id store u32 connection id?
Maybe we can support an extra item like
pub conn_id: u32
?Beta Was this translation helpful? Give feedback.
All reactions