strongduanmu commented on a change in pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853#discussion_r508210067
##########
File path:
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/impl/ShardingCreateProcedureStatementValidator.java
##########
@@ -42,7 +44,9 @@ public void preValidate(final ShardingRule shardingRule,
final SQLStatementConte
routineBodySegment.ifPresent(routineBody -> {
TableExtractor extractor = new TableExtractor();
validateTableNotExist(metaData,
extractor.extractNotExistTableFromRoutineBody(routineBody));
- validateShardingTable(metaData,
extractor.extractExistTableFromRoutineBody(routineBody));
+ Collection<SimpleTableSegment> existTables =
extractor.extractExistTableFromRoutineBody(routineBody);
+ validateShardingTable(metaData, existTables);
Review comment:
> Hi @strongduanmu
> I know this PR is a time-consuming job, Very appreciated your initiative!
> `Create procedure, function, view` is a troublesome but user-liked issue
that sometimes frustrates me to think about it. You are the pioneer for this
challenging one, so I wish you could improve it step by step for a satisfying
solution.
> At present, I can see the `create view` is narrowed to those single tables
(no sharding tables, broadcast tables) , isn't it? It seems a critical first
step for me, and I will give my +1 vote.
> However, here It looks like you enable `create function, procedure` on the
sharding table as well, right? Do you think these SQL could work well on all
the sharding tables and single tables? Or are there any restrictions?
>
> Look forward to hearing from you.
>
> Best,
> Trista
@tristaZero The `create function` and `create procedure` statements have
previously added a validator to limit the use of the sharding table. This pr is
only to modify the routing way of the `create function` and `create procedure`
statements and change it to all databases routing. 😂
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]