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

pgsql engine: 在查询模式下启用只读事务,工单执行启用读写事务,避免在查询模式下被函数修改数据 #2855

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

peixubin
Copy link
Contributor

@peixubin peixubin commented Nov 2, 2024

No description provided.

Copy link

request-info bot commented Nov 2, 2024

你好!感谢你反馈的问题/bug,但是你的描述好像是空的,我们需要你完整的信息,这样才能帮你解决问题 如果不知道怎么写,在新建issue的时候有若干个模板可供选择,祝好!

Copy link

codecov bot commented Nov 2, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.35%. Comparing base (69ddfd0) to head (8638d6b).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
sql/engines/pgsql.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2855      +/-   ##
==========================================
- Coverage   78.37%   78.35%   -0.02%     
==========================================
  Files         124      124              
  Lines       17573    17580       +7     
==========================================
+ Hits        13773    13775       +2     
- Misses       3800     3805       +5     

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

@peixubin
Copy link
Contributor Author

peixubin commented Nov 2, 2024

pgsql中的自定义函数可以修改数据,并且使用select func()的形式执行,在SQL查询功能中如果不限制事务的读写模式,就会存在很大的数据风险。

@LeoQuote
Copy link
Collaborator

LeoQuote commented Nov 4, 2024

其实比较好的实践是查询的时候使用的账号只有读权限, 当然你的方案也很好

@LeoQuote LeoQuote merged commit d97ccdc into hhyo:master Nov 4, 2024
9 of 10 checks passed
FLVE added a commit to FLVE/Archery that referenced this pull request Nov 23, 2024
pgsql engine: 在查询模式下启用只读事务,工单执行启用读写事务,避免在查询模式下被函数修改数据 (hhyo#2855)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants