Skip to content

When I use Create function, something bug happened #3465

@gfes980615

Description

@gfes980615
type product struct {
	Title     string `gorm:"column:title"`
        URL       string `gorm:"column:url"`
	Server    string `gorm:"column:server"`
	Amount    string `gorm:"column:amount"`
}

func (mp *aaa) Insert(DB *gorm.DB ) error {
        products := []*product{}
        tmp := &po.Maple8591Product{
		Title:"123",
		URL:"/test?123",
		Server:"aaa",
		Amount:"123456",
	}
       products = append(products,tmp)
	return DB.Create(products).Error
}

when the field value have question mark, I expect query is

insert into products (`title`,`url`,`server`,`amount`) values ("123","/test?123","aaa","123456")

but its actually is like

insert into products (`title`,`url`,`server`,`amount`) values ("123","/test"aaa"123","123456",?)

Is it's bug? or I used it wrong?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions