MT#6969 MT#9041 fix the aig sequence auto-increment

changes/24/224/1
Andrew Pogrebennyk 11 years ago
parent 8792fba714
commit b01f1b43c6

@ -11,11 +11,8 @@ update voip_allowed_ip_groups set group_id = group_id + @gid where group_id <= 1
update voip_usr_preferences set value = value + @gid where attribute_id in(@aigid, @maigid);
-- reset sequence table
-- "alter table x auto_increment=@y" fails, so work around it:
truncate table voip_aig_sequence;
select @ai := (select ifnull(max(group_id)+1,100) from voip_allowed_ip_groups);
set @qry = concat('alter table voip_aig_sequence auto_increment=',@ai);
prepare stmt from @qry;
execute stmt;
select max(group_id) into @ai from voip_allowed_ip_groups;
insert into voip_aig_sequence values(ifnull(@ai,100));
unlock tables;

Loading…
Cancel
Save