【单账号多地登录】索引删除脚本更新
This commit is contained in:
parent
4cafd42d2e
commit
1095276517
|
@ -1,23 +1 @@
|
||||||
DROP PROCEDURE IF EXISTS del_idx;
|
DROP INDEX user_id ON sys_user_token;
|
||||||
|
|
||||||
create procedure del_idx(IN p_tablename varchar(200), IN p_idxname VARCHAR(200))
|
|
||||||
|
|
||||||
begin
|
|
||||||
|
|
||||||
DECLARE str VARCHAR(250);
|
|
||||||
|
|
||||||
set @str=concat(' drop index ',p_idxname,' on ',p_tablename);
|
|
||||||
|
|
||||||
select count(*) into @cnt from information_schema.statistics where table_name=p_tablename and index_name=p_idxname ;
|
|
||||||
|
|
||||||
if @cnt >0 then
|
|
||||||
|
|
||||||
PREPARE stmt FROM @str;
|
|
||||||
|
|
||||||
EXECUTE stmt ;
|
|
||||||
|
|
||||||
end if;
|
|
||||||
|
|
||||||
end ;
|
|
||||||
|
|
||||||
call del_idx('sys_user_token','user_id');
|
|
Loading…
Reference in New Issue