I am experiencing an issue where two identical records with the same primary key are returned when querying the database in a short period of time. The issue seems to resolve itself shortly after and the query returns unique records as expected.

Here are the details:

GORM version: v1.25.7 Database type and version: MySQL5.7

The issue occurs when I perform a batch insert of data and then query the data. The query sometimes returns two records with the same primary key, and the data of the records is exactly the same. After a short period of time, the same query returns different records as expected.

Here is a simplified version of my code:

`

                   type Item struct {
                Id        int64
                TypeId    string
                Name      string
                IsDeleted int64
            }


            var items = []Item{
                {
                    TypeId: "10",
                    Name:   "zhang",
                },
                {
                    TypeId: "10",
                    Name:   "li",
                },
                {
                    TypeId: "10",
                    Name:   "wang",
                },
            }

            err := dbOrm.Create(&items).Error

            if err != nil {
                panic(err)
            }
            //////////////////////////////////////////////
            var (
                gots []*Item
            )

            selector := dbOrm.Model(new(Item)).Where("type_id = ? ", "10")
            selector = selector.Where("is_deleted = ?", 0)

            err = selector.Order("approver_order, id").Find(&gots).Error

            //return {Id:175765395,name:"zhang"}, {Id:175765396,name:"li"}, {Id:175765396,name:"li"}

`

The query condition is correct, and I am not using any caching mechanisms. The primary key of my table is an auto-incrementing field.

I suspect this might be a bug in GORM or the database driver. Could you please help me investigate this issue?

Thank you!

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking