fix -cache=true insert no clean cache #1672
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在生成model代码指定-cache=true时,如果表中只有主键没有其他唯一索引时候,insert是不删除缓存的,但是findone会查缓存,这样会有问题在findone不存在的数据时候会缓存* ,那先findone在insert就会有问题
When the generated model code specifies - cache = true, if there is only a primary key in the table and there is no other unique index, the insert will not delete the cache, but findone will check the cache, which will cause problems. If there is no data in findone, it will cache *, then findone will have problems in the insert first