During scaling, the index in the statement generating the table exceeds the length limit.
Bug Report
The create table SQL is generated and rewritten by kernel.
@sandynz I think we should deal with such corner cases, I think this is a bug.
Hi @strongduanmu , could you help to have a look at this issue?
@sandynz Thank you for your remind. @VeejaLiu This is not a bug, the logical index will add the actual table suffix in ShardingSphere. I think you should adjust the length of the logic logical index to avoid the actual index being too long.
@strongduanmu Thank you for your reply. But I don't agree with you. In the production environment, it's normal to have a long table name or index name. Even because of some historical factors, this bad design may already exist in the user's system. But we can't blame our users for this. I think as middleware developers, we should achieve maximum compatibility and non-invasive. We should predict this situation in advance and take corresponding actions, rather than let users modify their design (even bad design). Finally, thank you for your reply.
@VeejaLiu Of course, I agree that ShardingSphere should be as compatible with native databases as possible, but ShardingSphere needs to consider different databases, and indexes with the same name are not allowed in PostgreSQL databases, which is the reason for index rewriting.
If you are interested, you can try to sort out the index requirements of different databases, and then optimize the logic of existing index rewriting.
@strongduanmu Thank you! It explains the matter I've only used MySQL and haven't thought about other databases. This is really a thorny problem. Thank you for your reply.
Is the problem resolved?
@terrymanu I didn't solve the problem. I just shorten the length of the index to suit you. Your side... I don't know.
Hello , this issue has not received a reply for several days. This issue is supposed to be closed.
最终这个问题不解决了吗?
hhhh, still in status: volunteer wanted
mysql索引超长的问题可以通过修改这行代码解决。
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.