xorm 1.x版本和之前版本 针对空数组不兼容的问题 #1870
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#1870
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?
(1)0.x 版本insert 空数组不会报错,只是affected = 0,而现在会报 ErrNoElementsOnSlice,这在代码升级的时候会让insert方法都得重新考虑,之前只要不是err 就继续执行下面代码的逻辑都得重新审查,是否考虑过还采用原来方式?
(2)xorm 在affected 和 error 之间是如何取舍的,是否有一个原则我们可以遵循,例如“报错只包含 mysql + 网络错误 + 语法错误”,“无更新也是更新”这种
(3)这个报错和hook 也有冲突,hook的afterProcessor 是可以在hookCtx 中获取到err的,但看代码应该只有exec 里面的err 才会被hook 感知到,像 ErrNoElementsOnSlice 这种外层检查报错hook不会捕获,这对于通过hook 做监控 就存在漏报的问题
I think we can add all the error on hookCtx