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

[Bug] Searching for variables in streampark installed by postgresql report error #3451

Closed
2 of 3 tasks
DimitriMok opened this issue Jan 3, 2024 · 3 comments · Fixed by #3457
Closed
2 of 3 tasks
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@DimitriMok
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Java Version

1.8

Scala Version

2.12.x

StreamPark Version

2.1.2

Flink Version

1.15.3

deploy mode

kubernetes-application

What happened

We have installed streampark based on postgresql. Howerver, we found an error as following when searching for variables. There are some problems in page query variables by regexp match, but the version before 2.1.1 has nothing. By study source code, the sql changed from "'%${variable.variableCode}%'" to "concat ('%', #{variable.variableCode}, '%')" is not compatible with postgresql, though that can prevent the sql injection and compatible with mysql.

Error Exception

internal server error: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $2 ### The error may exist in class path resource [mapper/core/VariableMapper.xml] ### The error may involve org.apache.streampark.console.core.mapper.VariableMapper.page-Inline ### The error occurred while setting parameters ### SQL: select count(*) as total from t_variable v inner join t_user u on v.creator_id = u.user_id and v.team_id = ? and v.variable_code like concat('%', ?, '%') ### Cause: org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $2 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $2

Screenshots

image
image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!(您是否要贡献这个PR?)

Code of Conduct

@DimitriMok DimitriMok added the bug Something isn't working label Jan 3, 2024
@caicancai
Copy link
Member

Thank you for your feedback, we will try to fix this issue

@caicancai
Copy link
Member

@wolfboys @RocMarshal This question looks like a good first issue, what do you think?

@wolfboys wolfboys added the good first issue Good for newcomers label Jan 5, 2024
@VampireAchao
Copy link
Contributor

assign me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
4 participants