fix(mysql): cancel where condition for querying schema tables#3076
fix(mysql): cancel where condition for querying schema tables#3076
Conversation
| func (c *Executor) ShowSchemaTables(schema string) ([]string, error) { | ||
| query := fmt.Sprintf( | ||
| "select TABLE_NAME from information_schema.tables where table_schema='%s' and TABLE_TYPE in ('BASE TABLE','SYSTEM VIEW')", schema) | ||
| "select TABLE_NAME from information_schema.tables where table_schema='%s'", schema) | ||
|
|
||
| if c.IsLowerCaseTableNames() { | ||
| schema = strings.ToLower(schema) | ||
| query = fmt.Sprintf( | ||
| "select TABLE_NAME from information_schema.tables where lower(table_schema)='%s' and TABLE_TYPE in ('BASE TABLE','SYSTEM VIEW')", schema) | ||
| "select TABLE_NAME from information_schema.tables where lower(table_schema)='%s'", schema) | ||
|
|
There was a problem hiding this comment.
这样做视图可以显示了,那会影响其他不需要视图的方法
There was a problem hiding this comment.
能确定所有引用来源都不需要视图吗?包括基于mysql开发的mysql系插件
PR Code Suggestions ✨Explore these optional code suggestions:
|
- Introduce `ShowAllSchemaObjects` method to retrieve all table types - Implement `showSchemaObjects` helper method for flexible queries - Update `ShowSchemaTables` to use `showSchemaObjects` with specific parameters - Modify `context.go` to use `ShowAllSchemaObjects` for schema checks
85b66bd to
5d7420f
Compare
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
关联的 issue
https://github.com/actiontech/sqle-ee/issues/2419
描述你的变更
确认项(pr提交后操作)
Tip
请在指定复审人之前,确认并完成以下事项,完成后✅
not_compatibleneed_update_docDescription
新增 showSchemaObjects API
新增 ShowAllSchemaObjects 方法
更新 ShowSchemaTables 与 Context 调用
统一 schema 对象查询逻辑
Changes diagram
Changes walkthrough 📝
executor.go
executor 查询逻辑变更sqle/driver/mysql/executor/executor.go
context.go
context 表检测更新sqle/driver/mysql/session/context.go