Only one record in the database File table has a value, and the others are all null

        var children []model.File
        err = hub.db.Where("project_id = ? AND parent_id IS NULL OR project_id = ? AND parent_id = ''", project.ID, project.ID).Find(&children).Error
        if err != nil {
            return
        }
        for _, child := range children {
            fmt.Println(child.Snapshot)
        }

However, after detection, all other records are filled with the same value.

But we use the native library to execute the native sql log printed by gorm log, and the returned data is indeed normal. Use code:

    sqlStr := "SELECT * FROM `files` WHERE project_id = '2457027e-9ec2-4731-b63a-a02150613b1a' AND parent_id IS NULL OR project_id = '2457027e-9ec2-4731-b63a-a02150613b1a' AND parent_id = ''"
    rows, err := db.Query(sqlStr)
    if err != nil {
        fmt.Printf("query failed, err:%v\n", err)
        return
    }
    defer rows.Close()

    for rows.Next() {
        file := model.File{}
        err := rows.Scan(&file.FileName, &file.ModifiedDate, &file.FileName, &file.FileName, &file.FileName, &file.FileName, &file.FileName, &file.FilePath, &file.FilePath, &file.FileName, &file.FilePath, &file.Snapshot)
        if err != nil {
            return
        }
        fmt.Printf("snap: %+v \n", file.Snapshot)
    }

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