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申请查询权限增加系统库 #2746

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

feiazifeiazi
Copy link
Contributor

需求背景:

  1. 开发人员等 需要查询系统表,以便生成SQL语句(比如:重命名所有表,给所有的表的字段值+1等等需求)
    (select * from information_schema.TABLES limit 10; select * from information_schema.COLUMNS limit 10;)
    但执行时会报错。
    img_v3_02da_93bcb32c-7ada-485e-85c3-e039b21c427g

修改内容:

  1. 申请查询列表页面增加information_schema和performance_schema系统库。
    (后端get_all_databases方法,把系统库给屏蔽了,SQL查询和SQL上线不想显示系统库。
    但是权限申请希望显示。

image

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.30%. Comparing base (fab5ba9) to head (b0bf83c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2746   +/-   ##
=======================================
  Coverage   77.30%   77.30%           
=======================================
  Files         119      119           
  Lines       16316    16316           
=======================================
  Hits        12613    12613           
  Misses       3703     3703           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@feiazifeiazi
Copy link
Contributor Author

@LeoQuote 这个单看看有没有问题,能否合并?

@LeoQuote
Copy link
Collaborator

LeoQuote commented Aug 7, 2024

这个实现方法有点奇怪, 能否直接在引擎侧放开算了

@feiazifeiazi
Copy link
Contributor Author

这个实现方法有点奇怪, 能否直接在引擎侧放开算了

可以,我觉可行。再次确认一下?确认的话,我改一下。
MySQL这个库不能放开吧。

@hhyo
Copy link
Owner

hhyo commented Aug 24, 2024

information_schema的可以放开,不过在SQL工单上面可能还是要做下过滤

@feiazifeiazi
Copy link
Contributor Author

information_schema的可以放开,不过在SQL工单上面可能还是要做下过滤

问题是前端过滤还是后端过滤合理呢?

我想改 EngineBase类get_all_databases(self): 这个方法定义。
改为 get_all_databases(self, **kwargs):
前端调用时,加多 request_source参数 (请求来源: sql查询,sql上线, 权限申请等)
由子类的get_all_databases方法 根据不同来源返回不同的数据库结果,或默认结果。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants