You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: MySQL-style CREATE PROCEDURE/FUNCTION BEGIN...END syntax is not supported #25409
dropdatabase if exists mysql_compat_model15_routine;
createdatabasemysql_compat_model15_routine;
use mysql_compat_model15_routine;
createtablet_routine (
id intprimary key,
grp int,
v varchar(20),
key idx_grp_v(grp, v)
);
insert into t_routine values
(1,10,'a'),
(2,10,'b'),
(3,20,'c'),
(4,null,null);
delimiter $$
create procedure p_basic(in p_min int, out p_cnt int)
beginselectcount(*) into p_cnt from t_routine where id >= p_min;
select id, v from t_routine where id >= p_min order by id;
end$$
createfunctionf_add(x int, y int)
returns int
deterministic
no sql
begin
return x + y;
end$$
delimiter ;
call p_basic(2, @cnt);
select @cnt as out_count;
select f_add(2,3) as f_add_result;
MySQL result
id v
2 b
3 c
4 NULL
out_count
3
f_add_result
5
MO result
ERROR 1064 (HY000): SQL parser error ... near "
begin
select count(*) into p_cnt from t_routine where id >= p_min;
select id, v from t_routine where id >= p_min order by id;
end";
ERROR 1064 (HY000): SQL parser error ... near "
deterministic
no sql
begin
return x + y;
end";
ERROR 1122 (HY000): function p_basic doesn't exist
ERROR 20101 (HY000): internal error: the user variable cnt does not exist
ERROR 20105 (HY000): not supported: function or operator 'f_add'
Expected
MO should accept MySQL-compatible stored routine syntax for CREATE PROCEDURE and CREATE FUNCTION, including BEGIN ... END routine bodies and standard routine characteristics such as DETERMINISTIC / NO SQL.
Activity
daviszhen commentedon Sep 22, 2026
补充 JeecgBoot 应用证据(关联汇总 #29220):
JeecgBoot 上游
jeecg-boot/db/jeecgboot-mysql-5.7.sql包含 MySQL stored procedure。MatrixOne 导入时无法解析CREATE PROCEDURE ... BEGIN ... END例程体,因此适配器会删除该 routine block,应用只保留表和数据后启动。Before:原始 schema import 在 routine 处 parser error。
After:删除 routine 后 schema import 成功,但 stored procedure 功能丢失。需要在支持 MySQL compound routine syntax 后恢复原始 routine 并增加 JeecgBoot 回归验证。