[
https://issues.apache.org/jira/browse/IGNITE-18653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maksim Zhuravkov updated IGNITE-18653:
--------------------------------------
Description:
Since Apache Calcite's SqlParser maintains the number of dynamic parameters
internally (as a protected field) it is possible to simplify the check that
ensures that the number of dynamic parameters in a query is equal to the number
of provided parameters.
1) See how that check is implemented for an SqlExplain in
IgniteSqlValidator::validate - it simply checks the number of dynamic
parameters in a query. We can implement that check in similar fashion for other
queries.
2) Remove the redundant array of bound checks for dynamic parameters in
IgniteSqlValidator since they are going to be no longer necessary after this
change.
Solution:
Check the number of dynamic parameters prior to validation and reject the query
if the number of dynamic parameters in the query and the number of provided
parameters do not match.
was:
Since Apache Calcite's SqlParser maintains the number of dynamic parameters
internally (as a protected field) it is possible to simplify the check that
ensures that the number of dynamic parameters in a query is equal to the number
of provided parameters.
1) See how that check is implemented for an SqlExplain in
IgniteSqlValidator::validate - it simply checks the number of dynamic
parameters in a query. We can implement that check in similar fashion for other
queries.
2) Remove the redundant array of bound checks for dynamic parameters in
IgniteSqlValidator since they are going to be no longer necessary after this
change.
> Sql. The number of dynamic parameters can be checked once.
> ----------------------------------------------------------
>
> Key: IGNITE-18653
> URL: https://issues.apache.org/jira/browse/IGNITE-18653
> Project: Ignite
> Issue Type: Improvement
> Components: sql
> Reporter: Maksim Zhuravkov
> Assignee: Maksim Zhuravkov
> Priority: Minor
> Labels: calcite, calcite3-required, ignite-3
> Fix For: 3.0.0-beta2
>
>
> Since Apache Calcite's SqlParser maintains the number of dynamic parameters
> internally (as a protected field) it is possible to simplify the check that
> ensures that the number of dynamic parameters in a query is equal to the
> number of provided parameters.
> 1) See how that check is implemented for an SqlExplain in
> IgniteSqlValidator::validate - it simply checks the number of dynamic
> parameters in a query. We can implement that check in similar fashion for
> other queries.
> 2) Remove the redundant array of bound checks for dynamic parameters in
> IgniteSqlValidator since they are going to be no longer necessary after this
> change.
> Solution:
> Check the number of dynamic parameters prior to validation and reject the
> query if the number of dynamic parameters in the query and the number of
> provided parameters do not match.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)