📄 sp-code.result
字号:
create procedure empty()beginend;show procedure code empty;Pos Instructiondrop procedure empty;create function almost_empty()returns intreturn 0;show function code almost_empty;Pos Instruction0 freturn 3 0drop function almost_empty;create procedure code_sample(x int, out err int, out nulls int)begindeclare count int default 0;set nulls = 0;begindeclare c cursor for select name from t1;declare exit handler for not found close c;open c;loopbegindeclare n varchar(20);declare continue handler for sqlexception set err=1;fetch c into n;if isnull(n) thenset nulls = nulls + 1;elseset count = count + 1;update t2 set idx = count where name=n;end if;end;end loop;end;select t.name, t.idx from t2 t order by idx asc;end//show procedure code code_sample;Pos Instruction0 set count@3 01 set nulls@2 02 cpush c@03 hpush_jump 6 4 EXIT4 cclose c@05 hreturn 0 196 copen c@07 set n@4 NULL8 hpush_jump 11 5 CONTINUE9 set err@1 110 hreturn 511 cfetch c@0 n@412 jump_if_not 15 isnull(n@4)13 set nulls@2 (nulls@2 + 1)14 jump 1715 set count@3 (count@3 + 1)16 stmt 4 "update t2 set idx = count where name=n"17 hpop 118 jump 719 hpop 120 cpop 121 stmt 0 "select t.name, t.idx from t2 t order ..."drop procedure code_sample;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -