Commit 44d7340
committed
fix(mysql): encode copyfrom enum values as strings
Generated non-null enums are named string types, which mysqltsv does not accept through AppendValue. Recognize generated enum names, including external model qualification, and emit AppendString with an explicit string conversion.
Keep nullable driver.Valuer wrappers, overrides and ordinary types on their existing paths. Add CLI golden cases for scalar arguments, parameter-struct pointers and split models, with nullable, overridden and text controls.
Verified the tagged CI suite with all required process plugins, six CGO-free build targets, and live MySQL round trips. REPLACE duplicate-key semantics remain separate from this encoding fix.
Fixes #43241 parent 3c2546a commit 44d7340
17 files changed
Lines changed: 1598 additions & 0 deletions
File tree
- internal
- codegen/golang
- templates/go-sql-driver-mysql
- endtoend/testdata/copyfrom_enum/mysql
- db
- go
- model
- params
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
215 | 223 | | |
216 | 224 | | |
217 | 225 | | |
| |||
222 | 230 | | |
223 | 231 | | |
224 | 232 | | |
| 233 | + | |
225 | 234 | | |
226 | 235 | | |
227 | 236 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
Lines changed: 228 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments