go-gorm / playground

GORM Playground (Please Create PR for this project to report issues)
MIT License
88 stars 666 forks source link

`go-gorm/sharding` plugin would fail when combining with hints.ForceIndex #726

Open zhaojames0707 opened 2 months ago

zhaojames0707 commented 2 months ago

Explain your user case and expected results

I create a logical table named message, and use two underlying sharding tables: message_01 and message_02. When using go-gorm/sharding plugin alone, everything works well, as in test case TestSharding. However, after I added Clauses(hints.ForceIndex("idx_content")) in the query, the sharding plugin would fail, as in test case TestShardingAndForceIndex.