用宝塔创建数据库 结果把之前的数据库顶掉了,然后目前卡在那个数据库跑不了我们本来的存储过程,现在还不知道是为什么,但是我们软件还要运行数据库里的存储过程的。然后我复制原来的存储过程写进去,但是运行不了,现在就是宝塔上搭的mysql运行不了存储过程,存储过程代码应该没问题的
DROP PROCEDURE IF EXISTS `logon`;
CREATE DEFINER = `duojiaadmin`@`%` PROCEDURE `logon`(in in_username text ,in in_pass text)
BEGIN
#Routine body goes here...
DECLARE t_ver text;
DECLARE t_code int;
DECLARE t_kjgn text;
DECLARE t_parts text;
DECLARE t_normal text;
DECLARE t_super text;
DECLARE t_permission text;
set t_code=0;
select code,kjgn,permission,userpart into t_code,t_kjgn,t_permission,t_parts from userlogon
where username=in_username and pass1=password(in_pass);
if t_code=0 THEN
select 0 as t_ver;
else
call splitstring(t_permission,',');
select group_concat(部门) into t_normal from 权限 where id in (select val_ from tmp_split);
select group_concat(部门) into t_super from 权限 where instr(职务,'经理')>0 AND
id in (select val_ from tmp_split);
select pass1 into t_ver from userlogon where username='version';
select t_ver,t_code,t_kjgn,t_parts,t_normal,t_super,t_permission;
end if;
END;
这是运行代码
|
|