apache / apache/hugegraph

[Bug] Throw java.lang.IllegalArgumentException

Open
#2,167 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

### Bug Type (问题类型)

gremlin (结果不合预期)

### Before submit

- [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

### Environment (环境信息)

- HugeGraph Version: 0.12.0
- Storage Backend: inmemory
- Mixed Index Backend: none
- Link to discussed bug: none
- Operating system: macOS 13.2.1
- API/Driver: Java

### Expected & Actual behavior (期望与实际表现)

I first randomly create a graph. Then when I run the following query: `g.V().has('vl0', 'vp5',not(outside('0.004116615364223364','1419375483'))).where(values('vp1').min().is(not(neq(true))))` is thrown with an exception. I think this query is syntactically correct, but I trigger an exception.

- Expected behavior:
No exception should be expected to throw.

- Actual behavior:
A `java.lang.IllegalArgumentException` is thrown. But think the number comparison here is correct, `6` should support comparison between these two numbers: `0.004116615364223364`, `1419375483`. It should correct here **mathematically**.
```
HugeGraph exception :
java.lang.IllegalArgumentException: Can't compare between 6 >= 0.004116615364223364 and 6 <= 1419375483
```

### Vertex/Edge example (问题点 / 边数据举例)

- Steps to reproduce:
We are developing a fuzzing technique to test your GraphDB. We create a graph with 10 nodes and 20 edges. And try to make it clear to reproduce the bugs, **hope** to not cause much **inconvenience** to your reviewing, but we believe the problem does exist.
Following the following graph data generation query, we can reproduce the bugs:
- Create data
```
Vertex:
g.addV('vl0').property('vp0','0.3339539013475684').property(T.id,700457009111105536)
g.addV('vl0').property('vp1','true').property(T.id,700457009161437184)
g.addV('vl1').property('vp2','false').property(T.id,700457009182408704)
g.addV('vl1').property('vp2','true').property(T.id,700457009207574528)
g.addV('vl1').property('vp2','false').property(T.id,700457009228546048)
g.addV('vl0').property('vp5',''< dv/'').property(T.id,700457009262100480)
g.addV('vl0').property('vp1','false').property(T.id,700457009283072000)
g.addV('vl0').property('vp1','true').property('vp0','0.8014027285807791').property('vp3','7676832734260925597').property('vp5',''< dv/'').property(T.id,700457009308237824)
g.addV('vl0').property('vp1','true').property('vp3','2260223500735366837').property(T.id,700457009325015040)
g.addV('vl0').property('vp1','true').property('vp0','0.9319945383148139').property('vp3','-7201636825091991114').property(T.id,700457009354375168)
Edge:
g.V(700457009308237824).as('700457009308237824').V(700457009325015040).as('700457009325015040').addE('el3').from('700457009308237824').to('700457009325015040')
g.V(700457009182408704).as('700457009182408704').V(700457009283072000).as('700457009283072000').addE('el1').from('700457009182408704').to('700457009283072000')
g.V(700457009262100480).as('700457009262100480').V(700457009354375168).as('700457009354375168').addE('el3').from('700457009262100480').to('700457009354375168')
g.V(700457009161437184).as('700457009161437184').V(700457009262100480).as('700457009262100480').addE('el0').from('700457009161437184').to('700457009262100480')
g.V(700457009228546048).as('700457009228546048').V(700457009228546048).as('700457009228546048').addE('el2').from('700457009228546048').to('700457009228546048')
g.V(700457009228546048).as('700457009228546048').V(700457009182408704).as('700457009182408704').addE('el2').from('700457009228546048').to('700457009182408704')
g.V(700457009111105536).as('700457009111105536').V(700457009325015040).as('700457009325015040').addE('el3').from('700457009111105536').to('700457009325015040')
g.V(700457009283072000).as('700457009283072000').V(700457009111105536).as('700457009111105536').addE('el0').from('700457009283072000').to('700457009111105536')
g.V(700457009207574528).as('700457009207574528').V(700457009228546048).as('700457009228546048').addE('el2').from('700457009207574528').to('700457009228546048')
g.V(700457009354375168).as('700457009354375168').V(700457009308237824).as('700457009308237824').addE('el0').from('700457009354375168').to('700457009308237824')
g.V(700457009111105536).as('700457009111105536').V(700457009262100480).as('700457009262100480').addE('el3').from('700457009111105536').to('700457009262100480')
g.V(700457009325015040).as('700457009325015040').V(700457009283072000).as('700457009283072000').addE('el0').from('700457009325015040').to('700457009283072000')
g.V(700457009182408704).as('700457009182408704').V(700457009228546048).as('700457009228546048').addE('el2').from('700457009182408704').to('700457009228546048')
g.V(700457009207574528).as('700457009207574528').V(700457009207574528).as('700457009207574528').addE('el2').from('700457009207574528').to('700457009207574528')
g.V(700457009354375168).as('700457009354375168').V(700457009308237824).as('700457009308237824').addE('el3').from('700457009354375168').to('700457009308237824')
g.V(700457009228546048).as('700457009228546048').V(700457009207574528).as('700457009207574528').addE('el2').from('700457009228546048').to('700457009207574528')
g.V(700457009182408704).as('700457009182408704').V(700457009308237824).as('700457009308237824').addE('el1').from('700457009182408704').to('700457009308237824')
g.V(700457009207574528).as('700457009207574528').V(700457009354375168).as('700457009354375168').addE('el1').from('700457009207574528').to('700457009354375168')
g.V(700457009325015040).as('700457009325015040').V(700457009325015040).as('700457009325015040').addE('el0').from('700457009325015040').to('700457009325015040')
g.V(700457009283072000).as('700457009283072000').V(700457009308237824).as('700457009308237824').addE('el3').from('700457009283072000').to('700457009308237824')
```

### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

- Create schema
```
schema().propertyKey('vp0').asDouble().ifNotExist().create();
schema().propertyKey('vp1').asBoolean().ifNotExist().create();
schema().propertyKey('vp2').asBoolean().ifNotExist().create();
schema().propertyKey('vp3').asLong().ifNotExist().create();
schema().propertyKey('vp4').asFloat().ifNotExist().create();
schema().propertyKey('vp5').asText().ifNotExist().create();
schema().vertexLabel('vl0').ifNotExist().create();
schema().vertexLabel('vl0').properties('vp5').nullableKeys('vp5').append();
schema().indexLabel('vl0byvp5Shard').onV('vl0').by('vp5').shard().ifNotExist().create();
schema().vertexLabel('vl0').properties('vp3').nullableKeys('vp3').append();
schema().indexLabel('vl0byvp3Shard').onV('vl0').by('vp3').shard().ifNotExist().create();
schema().vertexLabel('vl0').properties('vp0').nullableKeys('vp0').append();
schema().indexLabel('vl0byvp0Shard').onV('vl0').by('vp0').shard().ifNotExist().create();
schema().vertexLabel('vl0').properties('vp1').nullableKeys('vp1').append();
schema().indexLabel('vl0byvp1Shard').onV('vl0').by('vp1').shard().ifNotExist().create();
schema().vertexLabel('vl1').ifNotExist().create();
schema().vertexLabel('vl1').properties('vp2').nullableKeys('vp2').append();
schema().indexLabel('vl1byvp2Shard').onV('vl1').by('vp2').shard().ifNotExist().create();
schema().propertyKey('ep0').asFloat().ifNotExist().create();
schema().propertyKey('ep1').asLong().ifNotExist().create();
schema().propertyKey('ep2').asDouble().ifNotExist().create();
schema().propertyKey('ep3').asFloat().ifNotExist().create();
schema().propertyKey('ep4').asBoolean().ifNotExist().create();
schema().propertyKey('ep5').asInt().ifNotExist().create();
schema().propertyKey('ep6').asText().ifNotExist().create();
schema().propertyKey('ep7').asBoolean().ifNotExist().create();
schema().edgeLabel('el0').link('vl0', 'vl0').ifNotExist().create();
schema().edgeLabel('el0').properties('ep7').nullableKeys('ep7').append();
schema().indexLabel('el0byep7Shard').onE('el0').by('ep7').shard().ifNotExist().create();
schema().edgeLabel('el1').link('vl0', 'vl1').ifNotExist().create();
schema().edgeLabel('el1').properties('ep6').nullableKeys('ep6').append();
schema().indexLabel('el1byep6Shard').onE('el1').by('ep6').shard().ifNotExist().create();
schema().edgeLabel('el1').properties('ep2').nullableKeys('ep2').append();
schema().indexLabel('el1byep2Shard').onE('el1').by('ep2').shard().ifNotExist().create();
schema().edgeLabel('el1').properties('ep0').nullableKeys('ep0').append();
schema().indexLabel('el1byep0Shard').onE('el1').by('ep0').shard().ifNotExist().create();
schema().edgeLabel('el1').properties('ep3').nullableKeys('ep3').append();
schema().indexLabel('el1byep3Shard').onE('el1').by('ep3').shard().ifNotExist().create();
schema().edgeLabel('el1').properties('ep5').nullableKeys('ep5').append();
schema().indexLabel('el1byep5Shard').onE('el1').by('ep5').shard().ifNotExist().create();
schema().edgeLabel('el1').properties('ep7').nullableKeys('ep7').append();
schema().indexLabel('el1byep7Shard').onE('el1').by('ep7').shard().ifNotExist().create();
schema().edgeLabel('el2').link('vl1', 'vl1').ifNotExist().create();
schema().edgeLabel('el2').properties('ep0').nullableKeys('ep0').append();
schema().indexLabel('el2byep0Shard').onE('el2').by('ep0').shard().ifNotExist().create();
schema().edgeLabel('el2').properties('ep5').nullableKeys('ep5').append();
schema().indexLabel('el2byep5Shard').onE('el2').by('ep5').shard().ifNotExist().create();
schema().edgeLabel('el2').properties('ep3').nullableKeys('ep3').append();
schema().indexLabel('el2byep3Shard').onE('el2').by('ep3').shard().ifNotExist().create();
schema().edgeLabel('el2').properties('ep7').nullableKeys('ep7').append();
schema().indexLabel('el2byep7Shard').onE('el2').by('ep7').shard().ifNotExist().create();
schema().edgeLabel('el3').link('vl0', 'vl0').ifNotExist().create();
schema().edgeLabel('el3').properties('ep2').nullableKeys('ep2').append();
schema().indexLabel('el3byep2Shard').onE('el3').by('ep2').shard().ifNotExist().create();
schema().edgeLabel('el3').properties('ep3').nullableKeys('ep3').append();
schema().indexLabel('el3byep3Shard').onE('el3').by('ep3').shard().ifNotExist().create();
schema().edgeLabel('el3').properties('ep0').nullableKeys('ep0').append();
schema().indexLabel('el3byep0Shard').onE('el3').by('ep0').shard().ifNotExist().create();
schema().edgeLabel('el3').properties('ep5').nullableKeys('ep5').append();
schema().indexLabel('el3byep5Shard').onE('el3').by('ep5').shard().ifNotExist().create();
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.