Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use cloud_fight;
- drop procedure if exists `konami`;
- drop function if exists `rand_string`;
- delimiter //
- CREATE FUNCTION `rand_string`(n INT) RETURNS varchar(255)
- BEGIN
- DECLARE chars_str varchar(255) DEFAULT 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789rew';
- DECLARE return_str varchar(255) DEFAULT '';
- DECLARE i INT DEFAULT 0;
- while i < n do
- SET return_str = concat(return_str,substring(chars_str , FLOOR(1 + RAND()*64 ),1));
- SET i = i + 1;
- END while;
- RETURN return_str;
- END //
- delimiter $$
- create procedure konami()
- begin
- declare q int default 1;
- while q<=2 DO
- set @N=rand_string(64);
- insert into fight_user (user_guid , first_name , last_name , user_name , nick_name , gender , city , province , country , head_img_url , created_at , last_updated) values (@N, '' , '' , '' , rand_string(5) , '2' , 'bj' , 'bj' , 'cn' , '' , now() , now());
- insert into fight_user_cake (fight_user_id , t_id , third_party_user_id , type , created_at , last_updated , status) select id , '2' , rand_string(20) , 'WECHAT_UNIONID' , now() , now() , 1 from fight_user where user_guid = @N;
- insert into fight_user_cake (fight_user_id , t_id , third_party_user_id , type , created_at , last_updated , status) select id , '2' , rand_string(20) , 'MP_OPENID' , now() , now() , 1 from fight_user where user_guid = @N;
- insert into fight_user_cake (fight_user_id , t_id , third_party_user_id , type , created_at , last_updated , status) select id , '2' , rand_string(20) , 'PA_OPENID' , now() , now() , 1 from fight_user where user_guid = @N;
- set q=q+1;
- end while;
- end $$
- call konami();
- drop function if exists `rand_string`;
- delimiter //
- CREATE FUNCTION `rand_string`(n INT) RETURNS varchar(255)
- BEGIN
- DECLARE chars_str varchar(255) DEFAULT 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789rew';
- DECLARE return_str varchar(255) DEFAULT '';
- DECLARE i INT DEFAULT 0;
- while i < n do
- SET return_str = concat(return_str,substring(chars_str , FLOOR(1 + RAND()*64 ),1));
- SET i = i + 1;
- END while;
- RETURN return_str;
- END //
- drop procedure if exists `konami`;
- delimiter $$
- create procedure konami()
- begin
- declare q int default 1;
- while q<=2 DO
- set @N=rand_string(64);
- insert into fight_user (user_guid , first_name , last_name , user_name , nick_name , gender , city , province , country , head_img_url , created_at , last_updated) values (@N, '' , '' , '' , rand_string(5) , '2' , 'bj' , 'bj' , 'cn' , '' , now() , now());
- insert into fight_user_cake (fight_user_id , t_id , third_party_user_id , type , created_at , last_updated , status) select id , '2' , rand_string(20) , 'WECHAT_UNIONID' , now() , now() , 1 from fight_user where user_guid = @N;
- insert into fight_user_cake (fight_user_id , t_id , third_party_user_id , type , created_at , last_updated , status) select id , '2' , rand_string(20) , 'MP_OPENID' , now() , now() , 1 from fight_user where user_guid = @N;
- insert into fight_user_cake (fight_user_id , t_id , third_party_user_id , type , created_at , last_updated , status) select id , '2' , rand_string(20) , 'PA_OPENID' , now() , now() , 1 from fight_user where user_guid = @N;
- set q=q+1;
- end while;
- end $$
- call konami();
Add Comment
Please, Sign In to add comment