Skip to content

Conversation

@924060929
Copy link
Contributor

@924060929 924060929 commented Mar 11, 2025

What problem does this PR solve?

fix prepare statement with sql cache throw NullPointerException, introduced by #33262.

forbid sql cache when useServerPrepStmts=true, the mysql protocol has different between COM_QUERY and COM_STMT_EXECUTE, the sql cache use the result of COM_QUERY, so we can not provide the result of sql cache for COM_STMT_EXECUTE

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

@Thearas
Copy link
Contributor

Thearas commented Mar 11, 2025

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?

@924060929
Copy link
Contributor Author

run buildall

@924060929
Copy link
Contributor Author

run buildall

morrySnow
morrySnow previously approved these changes Mar 11, 2025
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 11, 2025
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17603	5217	5096	5096
q2	2048	291	164	164
q3	10419	1683	753	753
q4	10220	1052	549	549
q5	7561	2448	2417	2417
q6	187	162	132	132
q7	916	748	617	617
q8	9310	1298	1141	1141
q9	4848	4962	4824	4824
q10	6849	2324	1892	1892
q11	487	274	265	265
q12	353	354	212	212
q13	17766	3702	3082	3082
q14	242	234	217	217
q15	540	479	484	479
q16	621	610	588	588
q17	597	883	355	355
q18	7079	6581	6451	6451
q19	1247	991	567	567
q20	325	347	199	199
q21	3077	2258	1962	1962
q22	1071	1027	992	992
Total cold run time: 103366 ms
Total hot run time: 32954 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5205	5133	5560	5133
q2	254	331	233	233
q3	2154	2693	2295	2295
q4	1417	1817	1392	1392
q5	4231	4157	4189	4157
q6	211	166	123	123
q7	1997	1966	1792	1792
q8	2660	2786	2601	2601
q9	7268	7364	7268	7268
q10	2927	3150	2771	2771
q11	606	516	490	490
q12	690	756	615	615
q13	3527	3975	3287	3287
q14	297	286	278	278
q15	554	488	487	487
q16	656	710	656	656
q17	1153	1665	1337	1337
q18	7776	7632	7535	7535
q19	894	853	903	853
q20	2016	2034	1889	1889
q21	5406	4854	5046	4854
q22	1112	1086	1046	1046
Total cold run time: 53011 ms
Total hot run time: 51092 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192321 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 991e98d74115caa996a5296a25ca872e4cad73fc, data reload: false

query1	1374	1027	1009	1009
query2	6329	1991	1982	1982
query3	11148	4824	4750	4750
query4	25877	23472	22941	22941
query5	3838	688	472	472
query6	316	215	203	203
query7	3990	510	290	290
query8	313	246	252	246
query9	8486	2554	2518	2518
query10	474	320	260	260
query11	15364	15140	14967	14967
query12	165	110	111	110
query13	1578	521	396	396
query14	9852	6249	6742	6249
query15	200	197	169	169
query16	7599	664	506	506
query17	1615	782	612	612
query18	2108	421	322	322
query19	217	179	164	164
query20	129	124	123	123
query21	210	130	109	109
query22	4651	4512	4390	4390
query23	34495	33549	33672	33549
query24	7495	2473	2464	2464
query25	520	486	403	403
query26	1152	283	168	168
query27	2605	508	339	339
query28	5004	2456	2440	2440
query29	743	558	422	422
query30	276	228	191	191
query31	925	884	799	799
query32	76	67	65	65
query33	545	355	323	323
query34	782	854	507	507
query35	817	834	809	809
query36	969	1020	920	920
query37	121	101	72	72
query38	4165	4242	4304	4242
query39	1509	1444	1488	1444
query40	223	123	105	105
query41	52	51	50	50
query42	123	102	103	102
query43	524	520	496	496
query44	1309	786	810	786
query45	175	175	169	169
query46	867	1045	643	643
query47	1860	1855	1797	1797
query48	388	431	316	316
query49	765	517	422	422
query50	738	769	412	412
query51	4319	4296	4261	4261
query52	109	104	96	96
query53	245	259	191	191
query54	519	485	431	431
query55	85	83	81	81
query56	278	270	251	251
query57	1162	1206	1109	1109
query58	250	241	237	237
query59	2741	2994	2994	2994
query60	296	298	254	254
query61	122	118	121	118
query62	752	752	698	698
query63	244	194	192	192
query64	4172	1035	662	662
query65	4574	4331	4357	4331
query66	950	406	297	297
query67	15926	15492	15295	15295
query68	8022	885	504	504
query69	435	313	261	261
query70	1214	1127	1045	1045
query71	430	288	254	254
query72	5709	3559	3834	3559
query73	631	705	353	353
query74	8908	9279	8875	8875
query75	3885	3177	2698	2698
query76	3030	1184	756	756
query77	790	356	284	284
query78	10207	10346	9365	9365
query79	2228	841	589	589
query80	610	522	444	444
query81	487	262	221	221
query82	589	126	99	99
query83	189	168	153	153
query84	239	91	71	71
query85	776	347	303	303
query86	376	310	283	283
query87	4454	4559	4412	4412
query88	3669	2194	2200	2194
query89	387	314	281	281
query90	1770	215	212	212
query91	148	141	110	110
query92	81	63	56	56
query93	1612	1068	577	577
query94	651	444	306	306
query95	350	266	258	258
query96	487	564	271	271
query97	3376	3412	3312	3312
query98	229	200	202	200
query99	1317	1372	1274	1274
Total cold run time: 279086 ms
Total hot run time: 192321 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.07	0.03	0.04
query3	0.23	0.06	0.06
query4	1.63	0.10	0.11
query5	0.56	0.53	0.54
query6	1.21	0.72	0.71
query7	0.03	0.01	0.02
query8	0.04	0.03	0.03
query9	0.58	0.51	0.53
query10	0.57	0.61	0.58
query11	0.15	0.11	0.11
query12	0.15	0.11	0.11
query13	0.61	0.60	0.60
query14	2.67	2.82	2.66
query15	0.91	0.86	0.85
query16	0.38	0.38	0.38
query17	1.00	1.01	1.03
query18	0.21	0.19	0.20
query19	1.91	1.78	2.01
query20	0.01	0.02	0.01
query21	15.38	0.91	0.54
query22	0.75	1.25	0.96
query23	14.70	1.37	0.68
query24	6.96	1.05	1.26
query25	0.46	0.20	0.23
query26	0.75	0.17	0.15
query27	0.05	0.05	0.04
query28	9.19	0.87	0.45
query29	12.56	4.07	3.38
query30	0.28	0.09	0.07
query31	2.81	0.58	0.38
query32	3.23	0.54	0.47
query33	3.01	3.06	3.01
query34	15.62	5.21	4.50
query35	4.63	4.57	4.52
query36	0.67	0.49	0.48
query37	0.09	0.07	0.07
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.17	0.14	0.13
query41	0.08	0.03	0.02
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 104.51 s
Total hot run time: 31.5 s

@924060929
Copy link
Contributor Author

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Mar 11, 2025
@924060929
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17598	5268	5057	5057
q2	2049	310	168	168
q3	10457	1271	741	741
q4	10199	1029	535	535
q5	7502	2387	2361	2361
q6	187	160	133	133
q7	905	788	620	620
q8	9302	1289	1059	1059
q9	4901	4818	4598	4598
q10	6815	2312	1893	1893
q11	468	273	275	273
q12	360	356	217	217
q13	17756	3723	3149	3149
q14	238	235	212	212
q15	525	484	484	484
q16	659	622	571	571
q17	595	850	361	361
q18	6896	6398	6416	6398
q19	2228	991	584	584
q20	332	324	191	191
q21	2924	2137	1935	1935
q22	984	1020	969	969
Total cold run time: 103880 ms
Total hot run time: 32509 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5271	5170	5177	5170
q2	242	329	236	236
q3	2151	2637	2281	2281
q4	1432	1807	1382	1382
q5	4254	4174	4175	4174
q6	214	163	126	126
q7	1984	1898	1779	1779
q8	2628	2674	2527	2527
q9	7234	7284	7242	7242
q10	3059	3233	2791	2791
q11	581	517	491	491
q12	704	742	568	568
q13	3488	4044	3268	3268
q14	283	293	273	273
q15	525	479	461	461
q16	671	688	649	649
q17	1166	1558	1394	1394
q18	7751	7631	7559	7559
q19	848	863	956	863
q20	2024	2043	1859	1859
q21	5496	4994	4719	4719
q22	1104	1094	1042	1042
Total cold run time: 53110 ms
Total hot run time: 50854 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 191812 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 9965643ef2d1d5c4a0981977b482a22b50e88e4e, data reload: false

query1	1421	997	978	978
query2	6200	1871	1854	1854
query3	11023	4397	4433	4397
query4	54814	24928	23455	23455
query5	5293	547	473	473
query6	369	204	186	186
query7	5049	509	293	293
query8	341	250	236	236
query9	6469	2638	2653	2638
query10	437	309	260	260
query11	15279	15268	14979	14979
query12	165	115	106	106
query13	1164	518	421	421
query14	10590	6936	6598	6598
query15	193	209	192	192
query16	6949	656	479	479
query17	1080	752	564	564
query18	1543	409	319	319
query19	203	196	171	171
query20	127	130	124	124
query21	207	130	107	107
query22	4573	4559	4357	4357
query23	34082	33402	33261	33261
query24	5818	2436	2444	2436
query25	460	458	414	414
query26	765	281	160	160
query27	1899	493	342	342
query28	2816	2454	2463	2454
query29	563	558	424	424
query30	281	226	185	185
query31	908	866	805	805
query32	72	65	64	64
query33	463	368	321	321
query34	761	841	515	515
query35	793	830	752	752
query36	953	1024	887	887
query37	124	94	73	73
query38	4211	4264	4143	4143
query39	1513	1482	1424	1424
query40	220	118	104	104
query41	58	52	58	52
query42	123	112	106	106
query43	495	506	485	485
query44	1320	801	802	801
query45	177	170	168	168
query46	847	1061	635	635
query47	1846	1850	1753	1753
query48	393	423	322	322
query49	705	511	449	449
query50	717	740	421	421
query51	4293	4364	4222	4222
query52	111	112	98	98
query53	236	258	187	187
query54	500	498	420	420
query55	88	84	84	84
query56	280	272	263	263
query57	1175	1164	1111	1111
query58	246	296	232	232
query59	2622	2744	2633	2633
query60	322	299	255	255
query61	124	136	120	120
query62	716	730	676	676
query63	242	190	187	187
query64	2027	1027	704	704
query65	4578	4425	4468	4425
query66	746	395	286	286
query67	16039	15397	15211	15211
query68	6732	877	505	505
query69	528	291	253	253
query70	1224	1040	1084	1040
query71	488	297	272	272
query72	5523	3578	3806	3578
query73	1280	735	354	354
query74	9033	9034	8936	8936
query75	3712	3159	2683	2683
query76	4279	1182	751	751
query77	627	348	273	273
query78	10048	10269	9348	9348
query79	2293	829	596	596
query80	713	523	448	448
query81	483	259	220	220
query82	667	127	93	93
query83	176	178	156	156
query84	283	89	71	71
query85	774	367	302	302
query86	384	301	261	261
query87	4380	4502	4382	4382
query88	3401	2232	2250	2232
query89	403	312	279	279
query90	1902	210	208	208
query91	142	134	107	107
query92	75	59	56	56
query93	1430	1069	578	578
query94	652	413	308	308
query95	354	270	249	249
query96	478	562	277	277
query97	3295	3357	3263	3263
query98	231	204	203	203
query99	1432	1377	1273	1273
Total cold run time: 298639 ms
Total hot run time: 191812 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.07	0.03	0.03
query3	0.23	0.07	0.06
query4	1.61	0.10	0.11
query5	0.57	0.54	0.55
query6	1.19	0.72	0.72
query7	0.02	0.02	0.02
query8	0.04	0.03	0.04
query9	0.57	0.52	0.52
query10	0.58	0.63	0.57
query11	0.16	0.11	0.11
query12	0.15	0.11	0.12
query13	0.61	0.61	0.60
query14	2.78	2.69	2.67
query15	0.93	0.85	0.86
query16	0.38	0.37	0.36
query17	1.05	1.01	1.04
query18	0.20	0.20	0.19
query19	1.91	1.74	1.94
query20	0.02	0.01	0.01
query21	15.39	0.88	0.54
query22	0.75	1.16	0.61
query23	15.00	1.36	0.62
query24	8.05	1.77	0.41
query25	0.52	0.29	0.08
query26	0.51	0.15	0.13
query27	0.06	0.05	0.04
query28	10.00	0.85	0.43
query29	12.58	3.95	3.34
query30	0.25	0.09	0.06
query31	2.83	0.59	0.39
query32	3.23	0.55	0.47
query33	2.97	3.03	2.99
query34	15.83	5.09	4.48
query35	4.53	4.51	4.51
query36	0.66	0.49	0.48
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.18	0.14	0.13
query41	0.08	0.03	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 106.77 s
Total hot run time: 30.17 s

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 12, 2025
@924060929 924060929 merged commit 74ad0e3 into apache:master Mar 12, 2025
28 of 29 checks passed
@924060929 924060929 deleted the test_prepare_sql_cache branch March 12, 2025 09:37
924060929 added a commit to 924060929/incubator-doris that referenced this pull request Mar 12, 2025
…erException (apache#48902)

fix prepare statement with sql cache throw NullPointerException,
introduced by apache#33262.

forbid sql cache when useServerPrepStmts=true, the mysql protocol has
different between COM_QUERY and COM_STMT_EXECUTE, the sql cache use the
result of COM_QUERY, so we can not provide the result of sql cache for
COM_STMT_EXECUTE

(cherry picked from commit 74ad0e3)
924060929 added a commit to 924060929/incubator-doris that referenced this pull request Mar 12, 2025
…erException (apache#48902)

fix prepare statement with sql cache throw NullPointerException,
introduced by apache#33262.

forbid sql cache when useServerPrepStmts=true, the mysql protocol has
different between COM_QUERY and COM_STMT_EXECUTE, the sql cache use the
result of COM_QUERY, so we can not provide the result of sql cache for
COM_STMT_EXECUTE

(cherry picked from commit 74ad0e3)
@morrySnow morrySnow added the p0_b label Mar 13, 2025
yiguolei pushed a commit that referenced this pull request Mar 13, 2025
dataroaring pushed a commit that referenced this pull request Mar 15, 2025
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…erException (apache#48902)

fix prepare statement with sql cache throw NullPointerException,
introduced by apache#33262.

forbid sql cache when useServerPrepStmts=true, the mysql protocol has
different between COM_QUERY and COM_STMT_EXECUTE, the sql cache use the
result of COM_QUERY, so we can not provide the result of sql cache for
COM_STMT_EXECUTE
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. dev/2.1.9-merged dev/3.0.5-merged p0_b reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants