delete 删除存着bug,配置offset的偏移不生效 #1894

Closed
opened 2021-04-12 03:53:48 +00:00 by DemoLiang · 2 comments

测试语句:使用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之后的所有的所有数据

测试语句:使用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之后的所有的所有数据
lunny added the
kind
bug
label 2021-04-12 04:58:45 +00:00
lunny added this to the 1.1.1 milestone 2021-04-12 04:58:48 +00:00
Owner

Which database are you using? I don't think database support the SQL syntax. I sent #1895 to return an error.

Which database are you using? I don't think database support the SQL syntax. I sent #1895 to return an error.
Author

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不允许这么干的,翻车现场了

> 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不允许这么干的,翻车现场了
lunny removed the
kind
bug
label 2021-06-07 08:23:00 +00:00
lunny removed this from the 1.1.1 milestone 2021-06-07 08:23:04 +00:00
lunny closed this issue 2021-06-07 08:23:08 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1894
No description provided.