Commit bb71ccf
fix(database/gdb): strip quote chars from schema in Model.TableFields (gogf#4730)
## Summary
When performing cross-database JOINs with soft-delete, the schema name
parsed from `` `schema`.`table` `` format retains database-specific
quote characters. These quoted schema names break `information_schema`
WHERE clause queries in `TableFields` lookups.
This PR strips quote characters from `usedSchema` in
`Model.TableFields()`, matching the existing unquoting pattern used for
`usedTable` via `guessPrimaryTableName`.
## Changes
- `database/gdb/gdb_model_utility.go`: Add quote-stripping for
`usedSchema` using `gstr.Trim` with database-specific quote chars from
`GetChars()`
## Test
Existing `Test_Issue2338` in MySQL
(`contrib/drivers/mysql/mysql_z_unit_issue_test.go:685`) covers this
case. The MariaDB version exists in PR gogf#4724 branch
(`contrib/drivers/mariadb/mariadb_z_unit_issue_test.go:688`), not yet
merged. Once both PRs are merged, the MariaDB test will also validate
this fix.
closes gogf#4725
Co-authored-by: John Guo <claymore1986@gmail.com>1 parent f67b2dc commit bb71ccf
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
0 commit comments