apache / apache/hugegraph

[Bug] mysql 后端导入数据可能出现数据覆盖 (base64编码后)

Open
#1,963 2 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 (问题类型)

logic (逻辑设计问题)

### Before submit

- [X] 我已经确认现有的 [Issues](https://github.com/hugegraph/hugegraph/issues) 与 [FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有相同 / 重复问题

### Environment (环境信息)

- Server Version: v0.11.x

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

使用mysql作为存储后端的时候插入数据的时候应该所有顶点插入。
目前出现问题会少顶点。
下图是新建顶点的时候,提交的数据id日志。customId 是自定义的long类型id。 storeId是hugegraph往数据库中插入数据时通过IdGenerator转换出来的base64值。在提交的时候一共插入了49个顶点
![image](https://user-images.githubusercontent.com/31173360/190355421-0610e146-5ea7-4558-a6ba-56bad8581712.png)

数据库中查看插入的id,一共只有41个
![image](https://user-images.githubusercontent.com/31173360/190355906-f592b91e-b98c-47b2-a9fd-0a90af27341d.png)

问题说明:
通过IdGenerator转换id的base64值时,会出现最后以为字符只有大小写不一样的情况:
![image](https://user-images.githubusercontent.com/31173360/190356232-d0ad7721-d444-4b1c-9211-0099de697cfa.png)
在mysql作为存储后端的时候,使用的语句是replace into,而mysql中是不区分大小写的,所以在插入的时候会出现更新覆盖id和propertis情况,导致插入的顶点丢失

目前看了0.12版本的代码,逻辑都没有变化,应该也会出现这个问题

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

_No response_

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

_No response_

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.