Skip to content

branch-3.0: [Fix](PreparedStatement) fix incorrect query result with prepared statement #46994#47011

Merged
eldenmoon merged 1 commit intobranch-3.0from
auto-pick-46994-branch-3.0
Jan 15, 2025
Merged

branch-3.0: [Fix](PreparedStatement) fix incorrect query result with prepared statement #46994#47011
eldenmoon merged 1 commit intobranch-3.0from
auto-pick-46994-branch-3.0

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #46994

…tement (#46994)

This pull request includes several changes to improve the handling of
placeholders and prepared statements, as well as some minor code
adjustments and additions to test cases.

### Improvements to Placeholder Handling:
* Added an `equals` method to the `Placeholder` class to allow
comparison of `Placeholder` objects.Otherwise `between ? and ?` which is
between predicate, will be rewriten to `= ?` which is equal predicate

### Enhancements to Prepared Statements:
* Added multiple test cases to validate the functionality of prepared
statements with various data types and structures, including arrays,
maps, and structs.

### Minor Code Adjustments:
* Incremented `_field_pos` in `open_dynamic_mode` method of
`MysqlRowBuffer` class to ensure correct position tracking.
@Thearas
Copy link
Contributor

Thearas commented Jan 15, 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?

@dataroaring dataroaring reopened this Jan 15, 2025
@Thearas
Copy link
Contributor

Thearas commented Jan 15, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17766	7583	7361	7361
q2	2052	164	161	161
q3	10650	1157	1192	1157
q4	10856	738	737	737
q5	8014	2939	2917	2917
q6	242	147	145	145
q7	1010	626	619	619
q8	10017	2010	2081	2010
q9	6810	6511	6564	6511
q10	7629	2360	2368	2360
q11	495	280	270	270
q12	439	220	216	216
q13	19180	3128	3081	3081
q14	244	222	211	211
q15	573	535	534	534
q16	717	631	614	614
q17	998	531	562	531
q18	7311	6755	6776	6755
q19	1508	1073	1003	1003
q20	476	211	194	194
q21	4383	3315	3132	3132
q22	1101	961	1025	961
Total cold run time: 112471 ms
Total hot run time: 41480 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7402	7325	7349	7325
q2	354	243	257	243
q3	3163	2978	2962	2962
q4	2072	1835	1808	1808
q5	5676	5751	5735	5735
q6	225	145	145	145
q7	2284	1800	1851	1800
q8	3376	3556	3475	3475
q9	9013	8813	8966	8813
q10	3691	3603	3579	3579
q11	588	490	494	490
q12	813	611	591	591
q13	8075	3187	3091	3091
q14	298	267	279	267
q15	567	518	529	518
q16	723	675	692	675
q17	1867	1607	1564	1564
q18	8322	7823	7350	7350
q19	1655	1534	1491	1491
q20	2034	1807	1821	1807
q21	5399	5123	5156	5123
q22	1094	1010	1016	1010
Total cold run time: 68691 ms
Total hot run time: 59862 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192627 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 d68a0d02101d527ee3e3115593697177bffe7d84, data reload: false

query1	985	370	364	364
query2	6538	2130	2113	2113
query3	6707	219	222	219
query4	33917	23748	23445	23445
query5	4326	470	452	452
query6	270	192	185	185
query7	4633	318	314	314
query8	291	222	221	221
query9	9489	2677	2672	2672
query10	466	263	267	263
query11	18074	15337	15412	15337
query12	154	107	104	104
query13	1644	438	423	423
query14	9815	7531	7340	7340
query15	263	180	180	180
query16	8126	448	500	448
query17	1701	594	568	568
query18	2135	320	318	318
query19	390	168	166	166
query20	117	114	108	108
query21	209	107	104	104
query22	4511	4231	4407	4231
query23	34879	33855	33875	33855
query24	11290	2834	2890	2834
query25	671	419	413	413
query26	1588	174	171	171
query27	2834	358	345	345
query28	7701	2455	2425	2425
query29	1001	480	443	443
query30	321	171	168	168
query31	1031	790	837	790
query32	99	62	61	61
query33	807	314	305	305
query34	928	522	516	516
query35	959	726	746	726
query36	1116	961	965	961
query37	148	84	82	82
query38	3974	3896	3958	3896
query39	1469	1454	1441	1441
query40	297	107	105	105
query41	55	53	52	52
query42	115	106	100	100
query43	537	499	498	498
query44	1191	815	812	812
query45	190	172	174	172
query46	1128	748	724	724
query47	1924	1812	1833	1812
query48	466	385	403	385
query49	1301	394	398	394
query50	816	433	407	407
query51	7255	7170	6993	6993
query52	106	93	91	91
query53	257	189	191	189
query54	1230	470	470	470
query55	85	78	78	78
query56	257	247	247	247
query57	1247	1130	1062	1062
query58	232	216	217	216
query59	3406	3354	3166	3166
query60	313	258	260	258
query61	124	112	110	110
query62	858	677	686	677
query63	221	193	193	193
query64	5344	665	672	665
query65	3273	3196	3201	3196
query66	1484	319	320	319
query67	15799	15553	15433	15433
query68	4784	574	582	574
query69	444	269	273	269
query70	1179	1146	1121	1121
query71	335	261	259	259
query72	6432	4070	4071	4070
query73	779	353	362	353
query74	10304	8979	9030	8979
query75	3347	2630	2658	2630
query76	2960	1057	1113	1057
query77	433	294	278	278
query78	10371	9572	9749	9572
query79	1113	596	615	596
query80	785	462	434	434
query81	523	242	246	242
query82	1253	130	118	118
query83	239	153	156	153
query84	237	81	82	81
query85	1131	315	294	294
query86	312	307	304	304
query87	4517	4388	4357	4357
query88	3720	2410	2348	2348
query89	417	295	300	295
query90	2105	192	193	192
query91	180	150	150	150
query92	58	60	51	51
query93	1065	552	540	540
query94	792	304	298	298
query95	356	258	260	258
query96	613	282	287	282
query97	3448	3171	3153	3153
query98	215	206	194	194
query99	1543	1316	1294	1294
Total cold run time: 301078 ms
Total hot run time: 192627 ms

@doris-robot
Copy link

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

query1	0.03	0.04	0.03
query2	0.06	0.03	0.03
query3	0.23	0.07	0.06
query4	1.62	0.10	0.10
query5	0.53	0.51	0.51
query6	1.13	0.72	0.73
query7	0.02	0.02	0.01
query8	0.04	0.03	0.05
query9	0.56	0.49	0.49
query10	0.54	0.55	0.56
query11	0.15	0.10	0.11
query12	0.13	0.12	0.12
query13	0.63	0.59	0.59
query14	2.92	3.07	2.89
query15	0.90	0.83	0.81
query16	0.38	0.37	0.39
query17	1.02	1.00	0.96
query18	0.24	0.22	0.22
query19	1.92	1.86	1.99
query20	0.01	0.01	0.00
query21	15.38	0.58	0.58
query22	2.53	2.03	1.64
query23	17.06	0.92	0.86
query24	3.16	1.87	0.47
query25	0.33	0.06	0.10
query26	0.45	0.14	0.14
query27	0.05	0.05	0.04
query28	10.39	1.11	1.08
query29	12.61	3.22	3.24
query30	0.25	0.08	0.06
query31	2.85	0.39	0.38
query32	3.24	0.46	0.46
query33	3.02	3.04	3.09
query34	17.02	4.49	4.54
query35	4.60	4.61	4.57
query36	0.67	0.48	0.52
query37	0.10	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.02	0.03
query40	0.17	0.12	0.13
query41	0.08	0.02	0.02
query42	0.03	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 107.17 s
Total hot run time: 32.32 s

@eldenmoon eldenmoon merged commit 92a0c17 into branch-3.0 Jan 15, 2025
11 of 12 checks passed
@github-actions github-actions bot deleted the auto-pick-46994-branch-3.0 branch January 15, 2025 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants