delete 删除存着bug,配置offset的偏移不生效 #1894
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1894
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
测试语句:使用limit配置删除的limit限制,offset偏移
DB["abcd"].Table(tht(tableId)).Where(where, args...).
OrderBy("result_id asc").Limit(limit, offset).Delete(new(TaskHost))
最后生成的语句:
DELETE FROM
task
WHERE (host=? and id = ?) ORDER BY result_id asc LIMIT 100 []interface {}{"10.10.110.110", 111}正常我们删除数据应该可以根据偏移,第offset之后的所有的所有数据
Which database are you using? I don't think database support the SQL syntax. I sent #1895 to return an error.
确实,不允许。
我开始写orm 查询语句的时候看着可以这么传入,以为可以这么干,我后面查了下好像不能运行这样的offset,可以单独加limit
我开始以为挺正常的一个操作,没注意mysql不允许这么干的,翻车现场了