Skip to content

Commit 4c7ca77

Browse files
authored
Merge branch 'master' into test/mariadb-pr6-layer3-issues
2 parents 918b42a + bb71ccf commit 4c7ca77

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

database/gdb/gdb_model_utility.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ func (m *Model) TableFields(tableStr string, schema ...string) (fields map[strin
3737
usedTable = m.db.GetCore().guessPrimaryTableName(tableStr)
3838
usedSchema = gutil.GetOrDefaultStr(m.schema, schema...)
3939
)
40+
// Strip quote characters from schema name, as it may come from cross-database
41+
// table parsing (e.g., `schema`.`table`) and contain database-specific quote chars.
42+
charL, charR := m.db.GetChars()
43+
if usedSchema != "" && (charL != "" || charR != "") {
44+
usedSchema = gstr.Trim(usedSchema, charL+charR)
45+
}
4046
// Sharding feature.
4147
usedSchema, err = m.getActualSchema(ctx, usedSchema)
4248
if err != nil {

0 commit comments

Comments
 (0)