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

用druid连接Postgresql刷新物化视图,刷新不了 #4931

Closed
shenQQQ opened this issue Sep 13, 2022 · 2 comments
Closed

用druid连接Postgresql刷新物化视图,刷新不了 #4931

shenQQQ opened this issue Sep 13, 2022 · 2 comments
Milestone

Comments

@shenQQQ
Copy link
Contributor

shenQQQ commented Sep 13, 2022

Caused by: java.sql.SQLException: sql injection violation, dbType postgresql, druid-version 1.2.4, class com.alibaba.druid.sql.ast.statement.SQLRefreshMaterializedViewStatement not allow : refresh materialized view <table_name>

如图,我该怎么做?

@wenshao wenshao added the Bug label Oct 5, 2022
@wenshao wenshao added this to the 1.2.13 milestone Oct 5, 2022
wenshao added a commit that referenced this issue Oct 5, 2022
@wenshao
Copy link
Member

wenshao commented Oct 6, 2022

https://github.com/alibaba/druid/releases/tag/1.2.13
问题已修复,请用新版本

@wenshao wenshao closed this as completed Oct 6, 2022
@wenshao wenshao added the Fixed label Oct 6, 2022
@shenQQQ
Copy link
Contributor Author

shenQQQ commented Oct 8, 2022

https://github.com/alibaba/druid/releases/tag/1.2.13 问题已修复,请用新版本

换了版本还是提示有注入风险。我是配合mybatis使用的druid,把物化视图刷新语句作为update语句来使用的。请问我是需要额外进行一些配置么?

org.springframework.jdbc.UncategorizedSQLException:

Error updating database. Cause: java.sql.SQLException: sql injection violation, dbType postgresql, druid-version 1.2.13, class com.alibaba.druid.sql.ast.statement.SQLRefreshMaterializedViewStatement not allow : REFRESH MATERIALIZED VIEW <table_name>

@Mapper
public interface XXXMapper {

@Update("REFRESH MATERIALIZED VIEW <table_name>")
void refreshMaterialzedView();

}

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

No branches or pull requests

2 participants