GORM Playground Link
go-gorm/playground#764
Description
When using the @ character in a string passed to Select(), the remaining strings passed to select are ignored.
For example, these two queries...
DB.Table("users").Select("name = 'test example.com' as is_example", "age").Scan(&results).Error
DB.Table("users").Select("name = 'test@example.com' as is_example", "age").Scan(&results).Error
... generates the following SQL, respectively...
SELECT name = 'test example.com' as is_example,age FROM `users`
SELECT name = 'test@example.com' as is_example FROM `users`
Note how in the second, age is left off. This only seems to happen if the @ is included in the first string.
GORM Playground Link
go-gorm/playground#764
Description
When using the
@character in a string passed toSelect(), the remaining strings passed to select are ignored.For example, these two queries...
... generates the following SQL, respectively...
Note how in the second,
ageis left off. This only seems to happen if the@is included in the first string.