jiangtao69039 opened a new issue #14211:
URL: https://github.com/apache/shardingsphere/issues/14211


   ## Bug Report
   mysql syntax file may be wrong. I found that it may be caused by the 
declareStatement grammar rules(line 682) in the DDLStatement.g4, The "variable" 
grammar rules  it refers to must start with '@' .
   
   example:  
   ```sql
   create
           function myfunTest(idx int)
           returns int
           comment 'test'
       begin
           declare res int;
           declare num1, num2 int  default 27;
           declare data1, data2 int;
           set num2 = 23, res = num1 + num2;
           set data1 = 1, data2 = 1;
           select id, id into  data1, data2 from sss where id = idx;
           set res :=  res * (data1 + data2);
           return (res);
       end;
   ```
   ![img](https://tttz.gitee.io/pic/ast/mysqlfun.png)
   
   
   
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to