Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql audit failed, when schema like "cmal-test" #193

Closed
sjjian opened this issue Jan 6, 2022 · 3 comments
Closed

Mysql audit failed, when schema like "cmal-test" #193

sjjian opened this issue Jan 6, 2022 · 3 comments
Labels
bug Something isn't working verified the issue all pr is verified
Milestone

Comments

@sjjian
Copy link
Member

sjjian commented Jan 6, 2022

SQLe Version
main

Describe the bug
Mysql audit failed, when schema like "cmal-test". error message:

Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-demo' at line 1

image

To Reproduce
Steps to reproduce the behavior:

  1. 在上线数据库创建一个schema "test-demo"
create database `test-demo`
  1. 在页面进行SQL审核,指定对应的schema "test-demo"
  2. 输入SQL进行审核
create table t1(id int)
  1. 审核失败,报错如描述所示

Expected behavior
期望审核成功

@sjjian sjjian added the bug Something isn't working label Jan 6, 2022
@sjjian sjjian added this to the v1.2201.0 milestone Jan 6, 2022
@sjjian
Copy link
Member Author

sjjian commented Jan 6, 2022

原因

  1. MySQL对象命令不包含出现中划线,如果需要使用则对象需要使用反引号包裹起来;
  2. 后端进行审核时会实时获取库表结构,使用语句查询未对test-demo 使用反引号包裹,导致查询语句语法错误

@Marcus9530
Copy link
Collaborator

复现版本 1.2112.0
sqle-cc48d26174ad061aefcd600aada7a38a2
复现步骤:
1.在上线数据库创建一个schema "test-demo"
create database test-demo
2.在页面进行SQL审核,指定对应的schema "test-demo"
3.输入SQL进行审核
create table t1(id int)
4.审核失败,报错如描述所示
image

@Marcus9530
Copy link
Collaborator

验证版本

验证步骤:
1.在上线数据库创建一个schema "test-demo"
create database test-demo
2.在页面进行SQL审核,指定对应的schema "test-demo"
3.输入SQL进行审核
create table t1(id int)
4.可以成功创建工单,且上线也成功
image
image

@Marcus9530 Marcus9530 added the verified the issue all pr is verified label Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verified the issue all pr is verified
Projects
None yet
Development

No branches or pull requests

2 participants