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
2026-01-26 20:37:48 +08:00
dev
2017-07-04 18:31:39 +08:00
2025-12-27 16:07:23 +08:00
2026-01-26 20:37:48 +08:00

English | 简体中文

goframe logo

Go Reference GoFrame CI OpenSSF Scorecard CII Best Practices Go Report Card Code Coverage Production Ready License

Release GitHub pull requests GitHub closed pull requests GitHub issues GitHub closed issues Stars Forks Ask DeepWiki

A powerful framework for faster, easier, and more efficient project development.

Installation

go get -u github.com/gogf/gf/v2

Documentation

Contributors

💖 Thanks to all the contributors who made GoFrame possible 💖

goframe contributors

License

GoFrame is licensed under the MIT License, 100% free and open-source, forever.

Description
No description provided
Readme MIT 34 MiB
Languages
GO 100%