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
MatrixOne:ERROR 1105 (HY000): You have an error in your SQL syntax; ...
MySQL:创建成功,CALL cp_hdl(); 返回 99
2. DECLARE … CURSOR + OPEN / FETCH / CLOSE
CREATE PROCEDURE cp_cur() 'begin declare d int default 0; declare cur cursor for select id from t2 order by id limit 1; declare continue handler for not found set d = -1; open cur; fetch cur into d; close cur; select d; end';
MatrixOne:ERROR 1105
MySQL:返回 1
3. 函数内 RETURN
CREATEFUNCTIONcf_ret(x int) RETURNS int LANGUAGE sql AS'begin return x*2; end';
MatrixOne:ERROR 1105
MySQL:SELECT cf_ret(21) → 42
4. GET DIAGNOSTICS
CREATE PROCEDURE cp_diag() 'begin declare n int default 0; declare exit handler for sqlexception begin get current diagnostics n = number; select n; end; select no_such_col_qq; end';
Activity
XuPeng-SH commentedon Nov 16, 2026
已将 #25410 合并到本 issue。其
DECLARE HANDLER/CURSOR范围已被本 issue 覆盖,原复现内容仍保留在 #25410 供参考;#25410 将以 duplicate 关闭。本 issue 继续跟踪完整的存储过程异常处理与游标能力,唯一 assignee @matrix-meow 保持不变。