Skip to content

Conversation

@yujun777
Copy link
Contributor

@yujun777 yujun777 commented Oct 30, 2025

What problem does this PR solve?

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

@hello-stephen
Copy link
Contributor

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?

@yujun777 yujun777 force-pushed the simplify-range-for-not branch from 4056cab to 09761ac Compare November 3, 2025 07:40
@yujun777 yujun777 force-pushed the simplify-range-for-not branch from 09761ac to 215aa53 Compare November 4, 2025 03:44
@yujun777
Copy link
Contributor Author

yujun777 commented Nov 4, 2025

run buildall

@yujun777
Copy link
Contributor Author

yujun777 commented Nov 4, 2025

run buildall

@yujun777 yujun777 changed the title [draft](simplify range) simplify range support not equal / is null / is not null [feat](simplify range) simplify range support not equal / is null / is not null Nov 4, 2025
@doris-robot
Copy link

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

query1	1049	427	386	386
query2	6557	1662	1675	1662
query3	6752	224	227	224
query4	26531	23814	23271	23271
query5	5233	630	484	484
query6	345	249	237	237
query7	4664	506	305	305
query8	322	267	254	254
query9	8710	2533	2522	2522
query10	518	351	281	281
query11	15243	15046	14786	14786
query12	195	121	115	115
query13	1686	587	458	458
query14	11540	9302	9198	9198
query15	214	194	176	176
query16	7693	688	544	544
query17	1637	807	645	645
query18	2055	465	379	379
query19	244	250	193	193
query20	147	138	127	127
query21	224	148	137	137
query22	4537	4850	4512	4512
query23	34705	33841	33580	33580
query24	8567	2524	2520	2520
query25	603	558	485	485
query26	1235	284	172	172
query27	2709	511	365	365
query28	4788	2237	2236	2236
query29	850	675	495	495
query30	466	322	200	200
query31	1180	833	757	757
query32	84	76	71	71
query33	595	385	326	326
query34	825	904	548	548
query35	856	864	779	779
query36	964	997	900	900
query37	116	111	85	85
query38	3477	3579	3450	3450
query39	1445	1401	1416	1401
query40	222	123	113	113
query41	59	57	54	54
query42	116	105	106	105
query43	488	489	481	481
query44	1221	731	733	731
query45	182	175	168	168
query46	897	1001	641	641
query47	1811	1807	1770	1770
query48	408	428	320	320
query49	774	511	419	419
query50	649	693	411	411
query51	3841	3840	3865	3840
query52	123	104	102	102
query53	231	262	195	195
query54	302	314	264	264
query55	94	89	81	81
query56	327	340	302	302
query57	1163	1183	1123	1123
query58	294	270	272	270
query59	2624	2654	2518	2518
query60	332	342	318	318
query61	163	153	159	153
query62	784	740	647	647
query63	231	192	190	190
query64	4414	1175	859	859
query65	3997	3947	3945	3945
query66	1064	425	340	340
query67	15426	15428	14933	14933
query68	8130	937	597	597
query69	484	317	294	294
query70	1298	1281	1296	1281
query71	496	353	317	317
query72	5948	4968	5079	4968
query73	657	583	360	360
query74	8825	9195	8670	8670
query75	3977	3397	2825	2825
query76	3675	1189	727	727
query77	816	434	313	313
query78	9449	9694	8889	8889
query79	2041	896	586	586
query80	675	579	514	514
query81	490	259	228	228
query82	451	158	132	132
query83	307	258	246	246
query84	299	114	91	91
query85	887	468	439	439
query86	365	315	294	294
query87	3754	3707	3603	3603
query88	3515	2209	2219	2209
query89	394	319	299	299
query90	2019	221	217	217
query91	164	165	137	137
query92	79	73	62	62
query93	1760	977	632	632
query94	677	424	348	348
query95	392	319	314	314
query96	485	579	274	274
query97	2950	2990	2884	2884
query98	237	219	213	213
query99	1455	1402	1302	1302
Total cold run time: 278949 ms
Total hot run time: 188824 ms

@doris-robot
Copy link

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

query1	0.06	0.04	0.05
query2	0.10	0.05	0.04
query3	0.24	0.08	0.08
query4	1.61	0.12	0.12
query5	0.28	0.26	0.26
query6	1.14	0.67	0.64
query7	0.03	0.03	0.03
query8	0.05	0.04	0.04
query9	0.60	0.53	0.53
query10	0.58	0.57	0.58
query11	0.17	0.11	0.11
query12	0.15	0.12	0.12
query13	0.62	0.60	0.60
query14	1.00	1.00	1.01
query15	0.84	0.84	0.83
query16	0.40	0.39	0.39
query17	1.02	1.05	1.04
query18	0.23	0.20	0.20
query19	1.89	1.78	1.82
query20	0.02	0.01	0.02
query21	15.44	0.21	0.12
query22	5.00	0.07	0.05
query23	15.68	0.25	0.10
query24	3.06	0.76	0.67
query25	0.07	0.07	0.06
query26	0.14	0.12	0.13
query27	0.06	0.05	0.05
query28	4.92	1.15	0.94
query29	12.54	3.98	3.25
query30	0.28	0.14	0.11
query31	2.82	0.59	0.39
query32	3.24	0.57	0.47
query33	3.03	3.05	3.10
query34	15.85	5.25	4.56
query35	4.57	4.54	4.53
query36	0.68	0.50	0.50
query37	0.10	0.07	0.07
query38	0.07	0.05	0.04
query39	0.03	0.03	0.03
query40	0.18	0.14	0.14
query41	0.09	0.04	0.03
query42	0.04	0.03	0.02
query43	0.04	0.03	0.04
Total cold run time: 98.96 s
Total hot run time: 27.76 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 91.12% (308/338) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 87.87% (297/338) 🎉
Increment coverage report
Complete coverage report

@yujun777
Copy link
Contributor Author

yujun777 commented Nov 4, 2025

run buildall

@yujun777 yujun777 changed the title [feat](simplify range) simplify range support not equal / is null / is not null [feat](nereids) simplify range support not equal / is null / is not null Nov 4, 2025
@doris-robot
Copy link

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

query1	1067	397	389	389
query2	6564	1658	1687	1658
query3	6755	233	220	220
query4	25947	23488	23303	23303
query5	5198	645	468	468
query6	339	237	214	214
query7	4646	511	298	298
query8	302	245	238	238
query9	8687	2556	2555	2555
query10	551	364	297	297
query11	15170	15257	15151	15151
query12	203	126	113	113
query13	1682	571	437	437
query14	11420	9077	9040	9040
query15	196	182	175	175
query16	7658	659	465	465
query17	1339	740	610	610
query18	2051	421	316	316
query19	204	190	166	166
query20	134	142	157	142
query21	347	141	122	122
query22	4492	4677	4511	4511
query23	34457	33789	33657	33657
query24	8483	2541	2470	2470
query25	651	540	471	471
query26	1292	298	159	159
query27	2751	520	360	360
query28	4472	2225	2229	2225
query29	799	699	531	531
query30	306	247	207	207
query31	977	879	736	736
query32	93	86	73	73
query33	627	400	362	362
query34	830	883	534	534
query35	853	886	960	886
query36	990	1034	915	915
query37	123	120	95	95
query38	3735	3626	3601	3601
query39	1466	1421	1413	1413
query40	224	131	122	122
query41	66	63	67	63
query42	126	108	110	108
query43	467	493	466	466
query44	1192	756	739	739
query45	188	178	174	174
query46	901	992	638	638
query47	1794	1801	1781	1781
query48	395	416	326	326
query49	782	515	431	431
query50	636	689	410	410
query51	3823	4009	3954	3954
query52	106	110	100	100
query53	234	270	198	198
query54	317	301	283	283
query55	86	85	87	85
query56	337	336	320	320
query57	1162	1197	1130	1130
query58	291	278	284	278
query59	2583	2624	2575	2575
query60	366	358	335	335
query61	208	182	186	182
query62	806	716	663	663
query63	228	192	192	192
query64	4513	1240	853	853
query65	4040	3951	3989	3951
query66	1088	427	341	341
query67	15692	15061	15044	15044
query68	8546	945	591	591
query69	512	324	289	289
query70	1333	1246	1287	1246
query71	520	332	307	307
query72	5818	4876	4660	4660
query73	674	556	349	349
query74	8789	9097	8655	8655
query75	3962	3283	2907	2907
query76	3858	1137	738	738
query77	837	405	319	319
query78	9671	9636	8819	8819
query79	2598	837	595	595
query80	754	552	485	485
query81	521	271	227	227
query82	452	159	132	132
query83	281	266	252	252
query84	286	111	92	92
query85	909	475	431	431
query86	391	272	308	272
query87	3717	3736	3605	3605
query88	3751	2207	2205	2205
query89	391	326	291	291
query90	2002	212	211	211
query91	168	169	137	137
query92	77	71	60	60
query93	2026	972	636	636
query94	686	453	330	330
query95	376	315	308	308
query96	482	564	272	272
query97	2936	2986	2859	2859
query98	247	206	208	206
query99	1412	1431	1287	1287
Total cold run time: 279491 ms
Total hot run time: 189098 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.05
query3	0.25	0.08	0.08
query4	1.60	0.12	0.12
query5	0.27	0.25	0.24
query6	1.16	0.65	0.64
query7	0.03	0.03	0.02
query8	0.05	0.04	0.04
query9	0.59	0.51	0.52
query10	0.57	0.58	0.57
query11	0.16	0.11	0.12
query12	0.15	0.12	0.12
query13	0.61	0.60	0.60
query14	1.00	1.00	1.00
query15	0.88	0.82	0.84
query16	0.40	0.40	0.39
query17	1.02	0.99	1.02
query18	0.22	0.20	0.20
query19	1.97	1.82	1.85
query20	0.02	0.01	0.02
query21	15.46	0.20	0.13
query22	5.08	0.06	0.04
query23	15.68	0.26	0.09
query24	2.67	1.20	0.30
query25	0.06	0.06	0.07
query26	0.14	0.14	0.12
query27	0.06	0.05	0.05
query28	4.30	1.15	0.94
query29	12.64	3.86	3.22
query30	0.28	0.15	0.12
query31	2.82	0.61	0.38
query32	3.23	0.55	0.49
query33	3.11	3.02	3.07
query34	15.80	5.19	4.55
query35	4.55	4.57	4.60
query36	0.69	0.50	0.49
query37	0.10	0.06	0.06
query38	0.07	0.04	0.04
query39	0.03	0.03	0.03
query40	0.18	0.14	0.15
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 98.21 s
Total hot run time: 27.32 s

@yujun777 yujun777 force-pushed the simplify-range-for-not branch from ad137ae to e0a8724 Compare November 6, 2025 07:14
yujun777 added a commit to yujun777/doris that referenced this pull request Nov 28, 2025
for RangeAll(a) intersect IsNull(a), cann't simplify it to FALSE because
when a is null, the result is null. Only when a is not null, can
simplify it to FALSE.

introduce by apache#57537
starocean999 pushed a commit that referenced this pull request Nov 28, 2025
…on (#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by #57537
yujun777 added a commit to yujun777/doris that referenced this pull request Nov 28, 2025
…on (apache#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 1, 2025
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 1, 2025
for RangeAll(a) intersect IsNull(a), cann't simplify it to FALSE because
when a is null, the result is null. Only when a is not null, can
simplify it to FALSE.

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 1, 2025
…on (apache#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 2, 2025
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 2, 2025
for RangeAll(a) intersect IsNull(a), cann't simplify it to FALSE because
when a is null, the result is null. Only when a is not null, can
simplify it to FALSE.

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 2, 2025
…on (apache#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 8, 2025
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 8, 2025
for RangeAll(a) intersect IsNull(a), cann't simplify it to FALSE because
when a is null, the result is null. Only when a is not null, can
simplify it to FALSE.

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Dec 8, 2025
…on (apache#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by apache#57537
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
for RangeAll(a) intersect IsNull(a), cann't simplify it to FALSE because
when a is null, the result is null. Only when a is not null, can
simplify it to FALSE.

introduce by apache#57537
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
…on (apache#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by apache#57537
morrySnow pushed a commit that referenced this pull request Jan 9, 2026
…es (#59671)

simplify range have exception:

mysql >  explain select pk from table_0_500_undef_partitions2_keys3_properties4_distributed_by5 where  not ( date_sub(col_date_undef_signed, interval 1 day) > '2010-03-21' or null ) or lower(col_varchar_20__undef_signed) between null and 'e';
(1105, "errCode = 2, detailMessage = Cannot compare two values with different data types: 2010-03-22 (DATEV2) vs 'e' (VARCHAR(1))")

PR #57537  introduce  merging compound value with other value desc.

when merge value desc, it will merge values with the same reference.

but for compound value,  its reference have other meaning:
1) a < 1 or a > 10,  this is a compound value,  its reference is a;
2) a < 1 or b > 10, this is a compound value, its reference is 'a < 1 or
b > 10'.

then for expression `TA > 1 and FALSE or FALSE and SB > 'abc''`, for the
operator OR, it will have two compound values:
a. C1 = CompoundValue(referece = getCompoundExpression(TA > 1 and FALSE)
= FALSE, source values={TA > 1, FALSE})
b. C2 = CompoundValue(reference = getCompoundExpression(FALSE and SB >
'abc') = FALSE, source values={FALSE, SB > 'abc'})

because the function getCompoundExpression will fold constant, then C1
andC2's referece will be 'FALSE', and since C1 and C2's reference
equals, then will try merge C1 and C2, then will check merge ' > 1' and
' > abc' will cause the above exception.

to fix this, for a compound value if its source values different
reference (like a < 1 or b > 10), then don't merge it with other values
descs.
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 9, 2026
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 9, 2026
for RangeAll(a) intersect IsNull(a), cann't simplify it to FALSE because
when a is null, the result is null. Only when a is not null, can
simplify it to FALSE.

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 9, 2026
…on (apache#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 9, 2026
…es (apache#59671)

simplify range have exception:

mysql >  explain select pk from table_0_500_undef_partitions2_keys3_properties4_distributed_by5 where  not ( date_sub(col_date_undef_signed, interval 1 day) > '2010-03-21' or null ) or lower(col_varchar_20__undef_signed) between null and 'e';
(1105, "errCode = 2, detailMessage = Cannot compare two values with different data types: 2010-03-22 (DATEV2) vs 'e' (VARCHAR(1))")

PR apache#57537  introduce  merging compound value with other value desc.

when merge value desc, it will merge values with the same reference.

but for compound value,  its reference have other meaning:
1) a < 1 or a > 10,  this is a compound value,  its reference is a;
2) a < 1 or b > 10, this is a compound value, its reference is 'a < 1 or
b > 10'.

then for expression `TA > 1 and FALSE or FALSE and SB > 'abc''`, for the
operator OR, it will have two compound values:
a. C1 = CompoundValue(referece = getCompoundExpression(TA > 1 and FALSE)
= FALSE, source values={TA > 1, FALSE})
b. C2 = CompoundValue(reference = getCompoundExpression(FALSE and SB >
'abc') = FALSE, source values={FALSE, SB > 'abc'})

because the function getCompoundExpression will fold constant, then C1
andC2's referece will be 'FALSE', and since C1 and C2's reference
equals, then will try merge C1 and C2, then will check merge ' > 1' and
' > abc' will cause the above exception.

to fix this, for a compound value if its source values different
reference (like a < 1 or b > 10), then don't merge it with other values
descs.
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 9, 2026
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 9, 2026
for RangeAll(a) intersect IsNull(a), cann't simplify it to FALSE because
when a is null, the result is null. Only when a is not null, can
simplify it to FALSE.

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 9, 2026
…on (apache#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 9, 2026
…es (apache#59671)

simplify range have exception:

mysql >  explain select pk from table_0_500_undef_partitions2_keys3_properties4_distributed_by5 where  not ( date_sub(col_date_undef_signed, interval 1 day) > '2010-03-21' or null ) or lower(col_varchar_20__undef_signed) between null and 'e';
(1105, "errCode = 2, detailMessage = Cannot compare two values with different data types: 2010-03-22 (DATEV2) vs 'e' (VARCHAR(1))")

PR apache#57537  introduce  merging compound value with other value desc.

when merge value desc, it will merge values with the same reference.

but for compound value,  its reference have other meaning:
1) a < 1 or a > 10,  this is a compound value,  its reference is a;
2) a < 1 or b > 10, this is a compound value, its reference is 'a < 1 or
b > 10'.

then for expression `TA > 1 and FALSE or FALSE and SB > 'abc''`, for the
operator OR, it will have two compound values:
a. C1 = CompoundValue(referece = getCompoundExpression(TA > 1 and FALSE)
= FALSE, source values={TA > 1, FALSE})
b. C2 = CompoundValue(reference = getCompoundExpression(FALSE and SB >
'abc') = FALSE, source values={FALSE, SB > 'abc'})

because the function getCompoundExpression will fold constant, then C1
andC2's referece will be 'FALSE', and since C1 and C2's reference
equals, then will try merge C1 and C2, then will check merge ' > 1' and
' > abc' will cause the above exception.

to fix this, for a compound value if its source values different
reference (like a < 1 or b > 10), then don't merge it with other values
descs.
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 12, 2026
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 12, 2026
for RangeAll(a) intersect IsNull(a), cann't simplify it to FALSE because
when a is null, the result is null. Only when a is not null, can
simplify it to FALSE.

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 12, 2026
…on (apache#58475)

Fix immutable map removeIf throw UnsupportedOperationException 

introduce by apache#57537
yujun777 added a commit to yujun777/doris that referenced this pull request Jan 12, 2026
…es (apache#59671)

simplify range have exception:

mysql >  explain select pk from table_0_500_undef_partitions2_keys3_properties4_distributed_by5 where  not ( date_sub(col_date_undef_signed, interval 1 day) > '2010-03-21' or null ) or lower(col_varchar_20__undef_signed) between null and 'e';
(1105, "errCode = 2, detailMessage = Cannot compare two values with different data types: 2010-03-22 (DATEV2) vs 'e' (VARCHAR(1))")

PR apache#57537  introduce  merging compound value with other value desc.

when merge value desc, it will merge values with the same reference.

but for compound value,  its reference have other meaning:
1) a < 1 or a > 10,  this is a compound value,  its reference is a;
2) a < 1 or b > 10, this is a compound value, its reference is 'a < 1 or
b > 10'.

then for expression `TA > 1 and FALSE or FALSE and SB > 'abc''`, for the
operator OR, it will have two compound values:
a. C1 = CompoundValue(referece = getCompoundExpression(TA > 1 and FALSE)
= FALSE, source values={TA > 1, FALSE})
b. C2 = CompoundValue(reference = getCompoundExpression(FALSE and SB >
'abc') = FALSE, source values={FALSE, SB > 'abc'})

because the function getCompoundExpression will fold constant, then C1
andC2's referece will be 'FALSE', and since C1 and C2's reference
equals, then will try merge C1 and C2, then will check merge ' > 1' and
' > abc' will cause the above exception.

to fix this, for a compound value if its source values different
reference (like a < 1 or b > 10), then don't merge it with other values
descs.
zzzxl1993 pushed a commit to zzzxl1993/doris that referenced this pull request Jan 13, 2026
…es (apache#59671)

simplify range have exception:

mysql >  explain select pk from table_0_500_undef_partitions2_keys3_properties4_distributed_by5 where  not ( date_sub(col_date_undef_signed, interval 1 day) > '2010-03-21' or null ) or lower(col_varchar_20__undef_signed) between null and 'e';
(1105, "errCode = 2, detailMessage = Cannot compare two values with different data types: 2010-03-22 (DATEV2) vs 'e' (VARCHAR(1))")

PR apache#57537  introduce  merging compound value with other value desc.

when merge value desc, it will merge values with the same reference.

but for compound value,  its reference have other meaning:
1) a < 1 or a > 10,  this is a compound value,  its reference is a;
2) a < 1 or b > 10, this is a compound value, its reference is 'a < 1 or
b > 10'.

then for expression `TA > 1 and FALSE or FALSE and SB > 'abc''`, for the
operator OR, it will have two compound values:
a. C1 = CompoundValue(referece = getCompoundExpression(TA > 1 and FALSE)
= FALSE, source values={TA > 1, FALSE})
b. C2 = CompoundValue(reference = getCompoundExpression(FALSE and SB >
'abc') = FALSE, source values={FALSE, SB > 'abc'})

because the function getCompoundExpression will fold constant, then C1
andC2's referece will be 'FALSE', and since C1 and C2's reference
equals, then will try merge C1 and C2, then will check merge ' > 1' and
' > abc' will cause the above exception.

to fix this, for a compound value if its source values different
reference (like a < 1 or b > 10), then don't merge it with other values
descs.
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. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants