-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
database/gdb: error rollback statement begin
for mssql2016, should be begin transaction
#3710
Comments
@zromet 只有mssql 2016以后的版本才有这个问题吗? |
begin
for mssql2016, should be begin transaction
@zromet Does this problem only occur in versions after mssql 2016? |
不是,应该是所有的sql.我看了源码,
它应该是直接用mysql的事务处理语句,,没有转换成sqlserver的事务处理语句.
database/gdb/gdb_core_transaction.go
中
John Guo ***@***.***> 於 2024年9月12日 週四 下午10:08寫道:
… @zromet <https://github.com/zromet> 只有mssql 2016以后的版本才有这个问题吗?
—
Reply to this email directly, view it on GitHub
<#3710 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADDORPP5U6JM5H3RJBZPYGTZWGN7NAVCNFSM6AAAAABLPWXSRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBWGQYDQMJZGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@zromet It may be necessary to propose the two keywords of the transaction as an interface for each database to implement itself. You can refer to the implementation of Welcome to submit PR and participate in the construction. |
mssql 驱动已经处理了 |
The mssql driver has processed |
@zromet 请提供可复现该问题的最小可运行代码。 |
@zromet Please provide minimal runnable code that reproduces the issue. |
Go version
go 1.22
GoFrame version
2.7.2
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
语句示例:
如插入数据不符表规则(key字段定义为int)时:
控制台报错 Error: mssql: 在将 nvarchar 值 '500.00' 转换成数据类型 int 时失败。 (这是期望报错)
除这以外 又报错 Error: mssql: ROLLBACK TRANSACTION 请求没有对应的 BEGIN TRANSACTION。(非期望报错)
此时返回前端的err 为 第二条(非期望报错),
数据库为SQL2016 它的事务定义开始为 BEGIN TRANSACTION 而非mysql 的 BEGIN
What did you see happen?
事务中 插入语句报错
What did you expect to see?
返回报错 Error: mssql: 在将 nvarchar 值 '500.00' 转换成数据类型 int 时失败
The text was updated successfully, but these errors were encountered: