Files
gf/database/gdb
Jack Ling bb71ccfd4c fix(database/gdb): strip quote chars from schema in Model.TableFields (#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 #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 #4725

Co-authored-by: John Guo <claymore1986@gmail.com>
2026-04-10 09:05:17 +08:00
..
2021-09-23 19:29:20 +08:00
2022-09-26 22:11:13 +08:00
2022-09-26 22:11:13 +08:00
2022-02-16 00:26:06 +08:00