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

[improvement](mysql)Support mysql COM_RESET_CONNECTION command. #44747

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

Jibing-Li
Copy link
Contributor

@Jibing-Li Jibing-Li commented Nov 28, 2024

What problem does this PR solve?

Support mysql COM_RESET_CONNECTION command.
Doris server side reset default catalog and return ctx.getState().setOk()

Python test code:

import mysql.connector

connection = mysql.connector.connect(
    host="172.20.32.136", 
    port=29030,
    user="root", 
    password="", 
    database=""
)
print(connection.cmd_reset_connection())

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Jibing-Li Jibing-Li marked this pull request as ready for review November 28, 2024 11:27
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Jibing-Li
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39693 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit a2f7a4702af1682a6011a7c07abba0f81873aedb, data reload: false

------ Round 1 ----------------------------------
q1	17618	7442	7230	7230
q2	2046	184	166	166
q3	10546	1137	1135	1135
q4	10215	712	703	703
q5	7620	2703	2716	2703
q6	237	148	148	148
q7	979	607	616	607
q8	9248	1864	1946	1864
q9	6657	6530	6466	6466
q10	6983	2305	2334	2305
q11	464	251	261	251
q12	425	216	207	207
q13	17762	2990	2973	2973
q14	250	209	208	208
q15	572	514	538	514
q16	672	593	585	585
q17	959	541	525	525
q18	7321	6889	6579	6579
q19	1341	1066	1067	1066
q20	491	179	181	179
q21	4097	3123	2976	2976
q22	380	303	329	303
Total cold run time: 106883 ms
Total hot run time: 39693 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7235	7398	7201	7201
q2	332	226	230	226
q3	2898	2739	2889	2739
q4	2049	1805	1799	1799
q5	5551	5517	5660	5517
q6	227	142	143	142
q7	2189	1805	1795	1795
q8	3323	3509	3530	3509
q9	9021	8960	9028	8960
q10	3610	3554	3581	3554
q11	602	510	508	508
q12	824	625	640	625
q13	11941	3303	3185	3185
q14	298	284	283	283
q15	578	516	535	516
q16	694	653	637	637
q17	1855	1599	1599	1599
q18	8248	7688	7725	7688
q19	1713	1636	1579	1579
q20	2085	1893	1859	1859
q21	5526	5465	5415	5415
q22	640	546	579	546
Total cold run time: 71439 ms
Total hot run time: 59882 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 191092 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit a2f7a4702af1682a6011a7c07abba0f81873aedb, data reload: false

query1	971	378	363	363
query2	6493	2096	2051	2051
query3	6710	208	211	208
query4	34031	23711	23621	23621
query5	4374	455	442	442
query6	266	197	187	187
query7	4635	303	304	303
query8	290	233	230	230
query9	9530	2716	2708	2708
query10	485	252	251	251
query11	18407	15147	15308	15147
query12	159	99	113	99
query13	1666	408	425	408
query14	10161	6690	6476	6476
query15	266	182	188	182
query16	8092	457	481	457
query17	1612	636	576	576
query18	2403	300	307	300
query19	362	162	154	154
query20	117	115	114	114
query21	214	104	109	104
query22	4638	4642	4507	4507
query23	35302	34576	34560	34560
query24	10511	2479	2513	2479
query25	618	406	407	406
query26	1237	151	154	151
query27	2715	286	281	281
query28	7862	2426	2412	2412
query29	823	397	400	397
query30	284	145	150	145
query31	1042	804	823	804
query32	83	54	57	54
query33	777	279	272	272
query34	952	498	521	498
query35	925	752	743	743
query36	1095	925	980	925
query37	150	75	76	75
query38	4473	4347	4215	4215
query39	1477	1411	1455	1411
query40	193	95	98	95
query41	44	40	42	40
query42	108	97	98	97
query43	541	473	480	473
query44	1275	813	798	798
query45	190	166	169	166
query46	1156	686	715	686
query47	1905	1818	1853	1818
query48	418	314	322	314
query49	1059	382	371	371
query50	790	379	394	379
query51	7274	7087	7171	7087
query52	98	91	93	91
query53	254	178	185	178
query54	974	406	404	404
query55	87	82	82	82
query56	259	227	243	227
query57	1284	1152	1146	1146
query58	223	206	212	206
query59	3261	3090	2909	2909
query60	272	260	243	243
query61	112	104	105	104
query62	887	657	676	657
query63	211	185	180	180
query64	4116	692	657	657
query65	3360	3212	3174	3174
query66	913	294	314	294
query67	15965	15434	15550	15434
query68	4804	562	527	527
query69	436	252	259	252
query70	1208	1214	1112	1112
query71	355	256	259	256
query72	6472	4095	4192	4095
query73	770	362	370	362
query74	10575	9222	9039	9039
query75	3439	2642	2665	2642
query76	2515	1127	1110	1110
query77	454	308	273	273
query78	10343	9438	9394	9394
query79	1815	583	608	583
query80	1177	421	431	421
query81	537	242	237	237
query82	949	124	115	115
query83	239	143	149	143
query84	254	71	70	70
query85	1385	299	296	296
query86	421	274	303	274
query87	4805	4572	4528	4528
query88	3545	2271	2197	2197
query89	393	287	297	287
query90	2025	192	190	190
query91	139	106	106	106
query92	69	50	52	50
query93	1613	532	532	532
query94	928	302	302	302
query95	363	249	294	249
query96	614	271	279	271
query97	2870	2674	2668	2668
query98	218	202	197	197
query99	1794	1288	1312	1288
Total cold run time: 300961 ms
Total hot run time: 191092 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.66 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit a2f7a4702af1682a6011a7c07abba0f81873aedb, data reload: false

query1	0.03	0.03	0.03
query2	0.07	0.03	0.03
query3	0.24	0.07	0.07
query4	1.62	0.10	0.11
query5	0.42	0.41	0.40
query6	1.14	0.66	0.65
query7	0.02	0.02	0.01
query8	0.04	0.03	0.02
query9	0.58	0.51	0.52
query10	0.56	0.55	0.55
query11	0.14	0.10	0.10
query12	0.14	0.11	0.12
query13	0.61	0.61	0.60
query14	2.74	2.72	2.73
query15	0.91	0.82	0.82
query16	0.40	0.37	0.37
query17	1.02	1.06	1.05
query18	0.22	0.22	0.21
query19	1.97	1.87	1.95
query20	0.02	0.01	0.01
query21	15.36	0.58	0.58
query22	2.71	2.72	1.57
query23	16.99	0.88	0.90
query24	3.23	1.18	1.59
query25	0.28	0.10	0.11
query26	0.55	0.13	0.14
query27	0.04	0.05	0.04
query28	9.75	1.10	1.08
query29	12.69	3.25	3.25
query30	0.25	0.07	0.07
query31	2.86	0.40	0.38
query32	3.25	0.46	0.47
query33	3.00	3.00	3.04
query34	17.17	4.48	4.44
query35	4.48	4.49	4.50
query36	0.67	0.50	0.48
query37	0.09	0.07	0.06
query38	0.04	0.03	0.03
query39	0.04	0.02	0.02
query40	0.15	0.12	0.13
query41	0.07	0.02	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 106.63 s
Total hot run time: 32.66 s

@morrySnow morrySnow added dev/2.1.x dev/3.0.x area/mysql-compatibility Issues or PRs related to the mysql compatibility labels Nov 28, 2024
@Jibing-Li
Copy link
Contributor Author

run buildall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 29, 2024
Copy link
Contributor

PR approved by at least one committer and no changes requested.

Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@doris-robot
Copy link

TPC-H: Total hot run time: 40264 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 407d8310c989a7f7a774e13b6192b5f8b9230dd9, data reload: false

------ Round 1 ----------------------------------
q1	17700	7482	7409	7409
q2	2058	192	176	176
q3	10630	1098	1135	1098
q4	10513	733	790	733
q5	7610	2756	2734	2734
q6	240	147	147	147
q7	992	642	615	615
q8	9255	1864	1956	1864
q9	6699	6520	6542	6520
q10	6951	2311	2311	2311
q11	462	273	266	266
q12	425	231	222	222
q13	17762	3036	3043	3036
q14	241	213	211	211
q15	567	534	531	531
q16	671	586	582	582
q17	978	644	516	516
q18	7409	6700	6738	6700
q19	1368	977	1016	977
q20	482	182	191	182
q21	4022	3261	3118	3118
q22	380	316	327	316
Total cold run time: 107415 ms
Total hot run time: 40264 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7254	7303	7249	7249
q2	329	236	230	230
q3	2929	2844	2894	2844
q4	2058	1814	1813	1813
q5	5733	5710	5705	5705
q6	227	147	143	143
q7	2269	1805	1801	1801
q8	3448	3579	3508	3508
q9	8958	9125	9068	9068
q10	3595	3559	3534	3534
q11	605	503	521	503
q12	838	563	601	563
q13	11323	3265	3274	3265
q14	298	272	293	272
q15	577	529	525	525
q16	690	637	647	637
q17	1863	1664	1636	1636
q18	8301	7888	7677	7677
q19	1716	1529	1426	1426
q20	2134	1955	1880	1880
q21	5542	5607	5404	5404
q22	693	575	584	575
Total cold run time: 71380 ms
Total hot run time: 60258 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 197789 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 407d8310c989a7f7a774e13b6192b5f8b9230dd9, data reload: false

query1	1242	964	927	927
query2	6240	2176	2117	2117
query3	10976	4378	4379	4378
query4	67346	29312	23806	23806
query5	5031	495	450	450
query6	423	193	180	180
query7	5680	305	303	303
query8	329	212	215	212
query9	9278	2653	2666	2653
query10	470	240	248	240
query11	17508	15370	16083	15370
query12	153	101	101	101
query13	1551	402	419	402
query14	11318	7212	7921	7212
query15	230	189	206	189
query16	7466	475	505	475
query17	1079	592	603	592
query18	1938	323	308	308
query19	239	166	159	159
query20	119	125	123	123
query21	210	103	107	103
query22	4551	4356	4596	4356
query23	35177	34418	34692	34418
query24	5376	2562	2498	2498
query25	471	387	387	387
query26	652	151	157	151
query27	1922	289	301	289
query28	4534	2486	2448	2448
query29	675	416	452	416
query30	207	157	163	157
query31	1001	802	842	802
query32	66	55	56	55
query33	461	295	284	284
query34	955	518	532	518
query35	884	780	760	760
query36	1087	959	952	952
query37	136	77	74	74
query38	4429	4472	4417	4417
query39	1560	1514	1501	1501
query40	208	101	105	101
query41	43	41	42	41
query42	105	97	98	97
query43	561	534	506	506
query44	1185	856	858	856
query45	183	167	171	167
query46	1165	728	743	728
query47	2012	1920	1943	1920
query48	424	316	322	316
query49	719	396	405	396
query50	858	396	402	396
query51	7349	7374	7150	7150
query52	101	84	92	84
query53	252	177	179	177
query54	510	401	390	390
query55	79	76	79	76
query56	239	242	239	239
query57	1258	1125	1143	1125
query58	252	214	215	214
query59	3317	3034	2970	2970
query60	268	256	240	240
query61	111	112	102	102
query62	786	681	669	669
query63	215	193	196	193
query64	1404	660	681	660
query65	3319	3192	3210	3192
query66	632	298	331	298
query67	15740	15663	15580	15580
query68	4266	584	551	551
query69	412	249	255	249
query70	1180	1125	1183	1125
query71	332	254	251	251
query72	6481	4053	4018	4018
query73	759	352	360	352
query74	10038	9107	9072	9072
query75	3422	2729	2644	2644
query76	1903	1126	1072	1072
query77	501	298	299	298
query78	10458	9437	9444	9437
query79	2132	590	601	590
query80	912	422	447	422
query81	526	233	226	226
query82	276	121	117	117
query83	187	147	150	147
query84	279	72	68	68
query85	966	304	326	304
query86	385	314	303	303
query87	4729	4573	4638	4573
query88	4498	2192	2192	2192
query89	419	295	291	291
query90	2055	188	189	188
query91	134	102	100	100
query92	61	49	50	49
query93	2254	544	543	543
query94	781	306	294	294
query95	346	262	251	251
query96	615	285	270	270
query97	2892	2621	2689	2621
query98	218	195	196	195
query99	1588	1310	1320	1310
Total cold run time: 322270 ms
Total hot run time: 197789 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.29 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 407d8310c989a7f7a774e13b6192b5f8b9230dd9, data reload: false

query1	0.03	0.03	0.04
query2	0.07	0.03	0.04
query3	0.23	0.08	0.07
query4	1.61	0.11	0.10
query5	0.43	0.42	0.42
query6	1.16	0.66	0.65
query7	0.02	0.01	0.02
query8	0.04	0.03	0.03
query9	0.61	0.51	0.50
query10	0.55	0.54	0.57
query11	0.15	0.10	0.11
query12	0.13	0.12	0.12
query13	0.62	0.60	0.59
query14	2.84	2.86	2.78
query15	0.90	0.84	0.84
query16	0.40	0.37	0.38
query17	1.02	1.05	1.02
query18	0.22	0.21	0.21
query19	1.85	1.72	1.98
query20	0.01	0.02	0.01
query21	15.36	0.60	0.57
query22	2.25	2.63	2.01
query23	17.27	0.89	0.79
query24	2.92	1.65	0.57
query25	0.32	0.10	0.14
query26	0.32	0.13	0.14
query27	0.04	0.04	0.05
query28	10.60	1.10	1.07
query29	12.52	3.21	3.23
query30	0.25	0.07	0.05
query31	2.86	0.38	0.38
query32	3.28	0.47	0.47
query33	3.00	3.10	3.09
query34	16.76	4.40	4.42
query35	4.49	4.56	4.48
query36	0.68	0.50	0.49
query37	0.09	0.07	0.06
query38	0.04	0.03	0.03
query39	0.04	0.03	0.02
query40	0.16	0.12	0.12
query41	0.08	0.02	0.02
query42	0.04	0.03	0.02
query43	0.04	0.03	0.04
Total cold run time: 106.3 s
Total hot run time: 32.29 s

@Jibing-Li Jibing-Li merged commit 0ffb71b into apache:master Nov 29, 2024
27 of 29 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 29, 2024
### What problem does this PR solve?
Support mysql COM_RESET_CONNECTION command.
Doris server side reset default catalog and return
ctx.getState().setOk()

Python test code:
```
import mysql.connector

connection = mysql.connector.connect(
    host="172.20.32.136", 
    port=29030,
    user="root", 
    password="", 
    database=""
)
print(connection.cmd_reset_connection())
```

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

### Release note

None
github-actions bot pushed a commit that referenced this pull request Nov 29, 2024
### What problem does this PR solve?
Support mysql COM_RESET_CONNECTION command.
Doris server side reset default catalog and return
ctx.getState().setOk()

Python test code:
```
import mysql.connector

connection = mysql.connector.connect(
    host="172.20.32.136", 
    port=29030,
    user="root", 
    password="", 
    database=""
)
print(connection.cmd_reset_connection())
```

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

### Release note

None
Jibing-Li added a commit that referenced this pull request Dec 2, 2024
Jibing-Li added a commit that referenced this pull request Dec 2, 2024
@Jibing-Li Jibing-Li deleted the reset branch December 2, 2024 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. area/mysql-compatibility Issues or PRs related to the mysql compatibility dev/2.1.8-merged dev/3.0.4-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants