fix Interface2Interface *sql.RawBytes light copy bug #2237

Closed
hsfish wants to merge 4 commits from master into master
First-time contributor

修复一次性查询多条数据,row转换为map[string]interface{} []byte切片浅拷贝问题。

修复一次性查询多条数据,row转换为map[string]interface{} []byte切片浅拷贝问题。
hsfish added 1 commit 2023-03-15 11:22:51 +00:00
fix Interface2Interface *sql.RawBytes light copy bug
Some checks failed
continuous-integration/drone/pr Build is failing
926930b7c5
Owner

What's the bug itself?

What's the bug itself?
Author
First-time contributor

When the number returned by the session.QueryInterface query is greater than 1, the same sql.Bytes is used. Here is a shallow copy, which will contaminate the previous data. Lead to garbled strings

image

When the number returned by the session.QueryInterface query is greater than 1, the same sql.Bytes is used. Here is a shallow copy, which will contaminate the previous data. Lead to garbled strings ![image](/attachments/c492d8c9-946e-401f-a2c1-bea077a590bc)
224 KiB
Owner

When the number returned by the session.QueryInterface query is greater than 1, the same sql.Bytes is used. Here is a shallow copy, which will contaminate the previous data. Lead to garbled strings

image

Thanks to point out. Could you add some unit test here?

> When the number returned by the session.QueryInterface query is greater than 1, the same sql.Bytes is used. Here is a shallow copy, which will contaminate the previous data. Lead to garbled strings > > ![image](/attachments/c492d8c9-946e-401f-a2c1-bea077a590bc) Thanks to point out. Could you add some unit test here?
hsfish added 1 commit 2023-03-18 03:43:11 +00:00
add Interface2Interface sqlRowBytes same addr test case
Some checks failed
continuous-integration/drone/pr Build is failing
141ce23b80
Author
First-time contributor

I submitted a test case to see what else needs to be adjusted

I submitted a test case to see what else needs to be adjusted
hsfish added 1 commit 2023-07-03 10:13:34 +00:00
PR xorm master
Some checks failed
test cockroach / test cockroach (pull_request) Has been cancelled
test mariadb / test mariadb (pull_request) Has been cancelled
test mssql / test mssql (pull_request) Has been cancelled
test mysql / test mysql (pull_request) Has been cancelled
test mysql8 / test mysql8 (pull_request) Has been cancelled
test postgres / test postgres (pull_request) Has been cancelled
test sqlite / unit test & test sqlite (pull_request) Has been cancelled
test tidb / test tidb (pull_request) Has been cancelled
0b266873f1
hsfish added 1 commit 2023-07-03 10:15:59 +00:00
Merge pull request 'master' (#2) from xorm/xorm:master into master
Reviewed-on: hsfish/xorm#2
Some checks failed
test cockroach / test cockroach (pull_request) Has been cancelled
test mariadb / test mariadb (pull_request) Has been cancelled
test mssql / test mssql (pull_request) Has been cancelled
test mysql / test mysql (pull_request) Has been cancelled
test mysql8 / test mysql8 (pull_request) Has been cancelled
test postgres / test postgres (pull_request) Has been cancelled
test sqlite / unit test & test sqlite (pull_request) Has been cancelled
test tidb / test tidb (pull_request) Has been cancelled
fa474ab33e
hsfish closed this pull request 2023-07-03 10:16:32 +00:00
Some checks failed
test cockroach / test cockroach (pull_request) Has been cancelled
test mariadb / test mariadb (pull_request) Has been cancelled
test mssql / test mssql (pull_request) Has been cancelled
test mysql / test mysql (pull_request) Has been cancelled
test mysql8 / test mysql8 (pull_request) Has been cancelled
test postgres / test postgres (pull_request) Has been cancelled
test sqlite / unit test & test sqlite (pull_request) Has been cancelled
test tidb / test tidb (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No description provided.