-
-
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
fixed:mssqlserver_insert_and_get #4051
base: master
Are you sure you want to change the base?
Conversation
修改多语言替换和参数无关
修改多语言替换和参数无关
修改多语言替换和参数无关
修改多语言替换和参数无关
修改多语言替换和参数无关 还原无关文件
修改多语言替换和参数无关 还原无关文件 处理测试不通过问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经加入注释
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码
…_id' into fixed_mssqlserver_insert_and_get_id
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码 重写Mssql的DoExec方法达到插入增加返回插入ID的目的
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码 重写Mssql的DoExec方法达到插入增加返回插入ID的目的
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码 重写Mssql的DoExec方法达到插入增加返回插入ID的目的 增加多条记录插入测试
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码 重写Mssql的DoExec方法达到插入增加返回插入ID的目的 增加多条记录插入测试 去除不必要的修改
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码 重写Mssql的DoExec方法达到插入增加返回插入ID的目的 增加多条记录插入测试 去除不必要的修改 去除不必要的代码
…_id' into fixed_mssqlserver_insert_and_get_id
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码 重写Mssql的DoExec方法达到插入增加返回插入ID的目的 增加多条记录插入测试 去除不必要的修改 去除不必要的代码
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码 重写Mssql的DoExec方法达到插入增加返回插入ID的目的 增加多条记录插入测试 去除不必要的修改 去除不必要的代码
…_id' into fixed_mssqlserver_insert_and_get_id
增加注释 撤销修改 修改明明避开包名开头 去除不必要的代码 修改框架DoInsert方法,增加参数,减少重复代码 重写Mssql的DoExec方法达到插入增加返回插入ID的目的 增加多条记录插入测试 去除不必要的修改 去除不必要的代码
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
处理了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
处理了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the InsertAndGetId method for MSSQL by ensuring that when inserting a record with an auto-increment primary key, the generated ID is correctly returned. Key changes include:
- Adding new test cases and helper functions in the MSSQL unit test files to verify the InsertAndGetId functionality.
- Modifying the driver execution logic in mssql_do_exec.go to incorporate an OUTPUT clause for retrieving the last inserted ID.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
contrib/drivers/mssql/mssql_z_unit_init_test.go | Added constants and helper function for creating a test table. |
contrib/drivers/mssql/mssql_z_unit_basic_test.go | Introduced tests for InsertAndGetId and table name extraction functions. |
contrib/drivers/mssql/mssql_do_exec.go | Updated SQL execution and output retrieval logic for InsertAndGetId. |
修复mssqlserver的InsertAndGetId方法;插入记录如果是自增主键则返回ID