Skip to content

branch-3.0: [fix](decimal)Fix the issue where decimal multiplication produces incorrect results due to mul_overflow error #51533 #51564

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

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 7, 2025

Cherry-picked from #51533

…orrect results due to mul_overflow error (#51533)

### What problem does this PR solve?

Previously, when multiplying -15687000000000000000000 (int128) by
11000000000000000 (int128), the mul_overflow function would incorrectly
return false (indicating no overflow)

```
mysql> select -15687.000000000000000000 * 0.011000000000000000;
+--------------------------------------------------+
| -15687.000000000000000000 * 0.011000000000000000 |
+--------------------------------------------------+
|            167.725366920938463463374607431768211 |
+--------------------------------------------------+
```
now
```
mysql> select -15687.000000000000000000 * 0.011000000000000000;
+--------------------------------------------------+
| -15687.000000000000000000 * 0.011000000000000000 |
+--------------------------------------------------+
|           -172.557000000000000000000000000000000 |
+--------------------------------------------------+
```
@github-actions github-actions bot requested a review from dataroaring as a code owner June 7, 2025 04:51
@Thearas
Copy link
Contributor

Thearas commented Jun 7, 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 closed this Jun 7, 2025
@dataroaring dataroaring reopened this Jun 7, 2025
@Thearas
Copy link
Contributor

Thearas commented Jun 7, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17596	6783	6551	6551
q2	2072	168	168	168
q3	10598	1102	1149	1102
q4	10545	768	718	718
q5	7753	2902	2899	2899
q6	213	133	131	131
q7	996	634	601	601
q8	9350	1970	2040	1970
q9	6633	6405	6407	6405
q10	6971	2316	2305	2305
q11	461	269	255	255
q12	403	213	212	212
q13	17771	2955	2998	2955
q14	249	202	213	202
q15	511	464	470	464
q16	497	397	391	391
q17	992	595	567	567
q18	7397	6906	6770	6770
q19	1394	1077	1069	1069
q20	484	198	209	198
q21	3976	3181	3246	3181
q22	1094	976	972	972
Total cold run time: 107956 ms
Total hot run time: 40086 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6590	6557	6541	6541
q2	331	235	228	228
q3	2915	2721	2918	2721
q4	2046	1835	1752	1752
q5	5764	5773	5710	5710
q6	216	128	128	128
q7	2166	1818	1842	1818
q8	3348	3564	3535	3535
q9	8920	8830	8963	8830
q10	3533	3500	3500	3500
q11	590	500	490	490
q12	805	625	613	613
q13	9037	3100	3144	3100
q14	300	280	287	280
q15	506	463	460	460
q16	484	440	436	436
q17	1827	1636	1613	1613
q18	8288	7768	7884	7768
q19	1678	1525	1641	1525
q20	2066	1812	1804	1804
q21	5432	5340	5242	5242
q22	1103	1042	1018	1018
Total cold run time: 67945 ms
Total hot run time: 59112 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 195567 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 2ec25e7a93274cd79595dc948dbc08859a6bd310, data reload: false

query1	1290	893	897	893
query2	6341	1891	1848	1848
query3	10840	4209	4263	4209
query4	60989	30517	23795	23795
query5	5195	467	463	463
query6	400	180	175	175
query7	5512	323	324	323
query8	308	222	215	215
query9	8622	2576	2557	2557
query10	466	266	249	249
query11	17855	15088	15721	15088
query12	168	102	105	102
query13	1451	452	430	430
query14	10326	6670	7223	6670
query15	194	172	174	172
query16	6971	451	493	451
query17	1255	554	602	554
query18	1670	338	329	329
query19	209	160	162	160
query20	114	109	114	109
query21	211	108	106	106
query22	4795	4442	4655	4442
query23	34126	33853	33725	33725
query24	6249	2962	3051	2962
query25	576	426	418	418
query26	649	173	174	173
query27	1720	379	366	366
query28	3990	2204	2143	2143
query29	704	496	458	458
query30	238	156	160	156
query31	988	818	814	814
query32	67	59	57	57
query33	433	317	301	301
query34	908	513	534	513
query35	846	718	708	708
query36	1098	970	949	949
query37	121	71	70	70
query38	4023	3929	4010	3929
query39	1499	1472	1490	1472
query40	206	104	101	101
query41	49	48	53	48
query42	113	101	102	101
query43	499	480	472	472
query44	1205	821	848	821
query45	187	172	172	172
query46	1159	715	718	715
query47	2032	1902	1930	1902
query48	491	386	381	381
query49	717	390	377	377
query50	840	426	437	426
query51	7446	7192	7284	7192
query52	99	89	88	88
query53	264	196	186	186
query54	572	447	461	447
query55	79	76	78	76
query56	283	245	248	245
query57	1312	1176	1163	1163
query58	215	227	214	214
query59	3207	2935	2998	2935
query60	294	258	257	257
query61	107	105	132	105
query62	775	680	686	680
query63	221	191	187	187
query64	1322	678	617	617
query65	3306	3152	3162	3152
query66	702	287	292	287
query67	15857	15566	15566	15566
query68	4133	598	587	587
query69	435	255	262	255
query70	1182	1108	1086	1086
query71	353	266	245	245
query72	6384	4002	3965	3965
query73	765	341	352	341
query74	10165	8858	8919	8858
query75	3384	2618	2614	2614
query76	1975	1068	1152	1068
query77	512	272	269	269
query78	10568	9532	9487	9487
query79	1107	602	593	593
query80	732	438	457	438
query81	512	233	219	219
query82	209	90	85	85
query83	157	143	143	143
query84	286	74	73	73
query85	832	288	290	288
query86	313	308	306	306
query87	4371	4292	4191	4191
query88	4052	2358	2329	2329
query89	412	289	293	289
query90	2031	216	186	186
query91	182	148	147	147
query92	63	51	49	49
query93	1365	558	568	558
query94	741	281	305	281
query95	361	269	253	253
query96	603	280	281	280
query97	3255	3142	3140	3140
query98	218	197	189	189
query99	1799	1308	1288	1288
Total cold run time: 310433 ms
Total hot run time: 195567 ms

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 41.11% (10871/26446)
Line Coverage 31.93% (92935/291033)
Region Coverage 31.03% (47968/154583)
Branch Coverage 27.52% (24583/89318)

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.07	0.03	0.02
query3	0.23	0.07	0.07
query4	1.61	0.10	0.10
query5	0.53	0.51	0.50
query6	1.13	0.73	0.72
query7	0.02	0.02	0.02
query8	0.05	0.03	0.03
query9	0.57	0.50	0.50
query10	0.56	0.55	0.56
query11	0.15	0.10	0.10
query12	0.14	0.12	0.11
query13	0.60	0.60	0.59
query14	0.75	0.79	0.79
query15	0.85	0.82	0.82
query16	0.38	0.39	0.38
query17	0.99	1.01	1.04
query18	0.22	0.21	0.22
query19	1.89	1.86	1.82
query20	0.02	0.01	0.01
query21	15.40	0.58	0.56
query22	3.13	1.93	2.16
query23	17.04	0.95	0.89
query24	2.93	1.71	0.47
query25	0.23	0.18	0.09
query26	0.49	0.13	0.14
query27	0.04	0.04	0.05
query28	10.45	0.48	0.44
query29	12.56	3.29	3.26
query30	0.24	0.06	0.06
query31	2.87	0.38	0.38
query32	3.25	0.46	0.46
query33	2.96	2.97	3.03
query34	17.04	4.44	4.43
query35	4.51	4.51	4.48
query36	0.67	0.48	0.47
query37	0.09	0.06	0.07
query38	0.05	0.04	0.04
query39	0.04	0.02	0.03
query40	0.15	0.12	0.12
query41	0.08	0.02	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.09 s
Total hot run time: 29.75 s

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit 26d7a9f into branch-3.0 Jun 10, 2025
21 of 24 checks passed
@github-actions github-actions bot deleted the auto-pick-51533-branch-3.0 branch June 10, 2025 02:18
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