CREATE DEFINER = 'leo'@'%'
PROCEDURE PlayGround.procedure1()
BEGIN

  SET @saved_sql_mode = @@sql_mode;
  SET @@sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,NO_AUTO_CREATE_USER';
  set @Current_Isolation_Level = @@tx_isolation;
  set SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; 


  drop temporary table if exists T_Temp_Test;
  CREATE Temporary TABLE T_Temp_Test (
  `Date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `Value` varchar(255),
  `MoreValue` varchar(255),
  `MoreValue2` varchar(255)
) engine innodb;

  set @1oop = 0;

  WHILE @1oop < 1000000 DO
    Insert Into T_Temp_Test (`Value`, `MoreValue`,`MoreValue2`) values (Rand(),
      '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789',
      '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
      );
    SET @1oop = @1oop + 1;
  END WHILE;

  set @Rand = rand();
  if (@Rand < 0.25) then alter table  T_Temp_Test drop `Date`; 
  elseif (@Rand >=0.25 and @Rand < 0.50) then alter table  T_Temp_Test drop `Value`; 
  elseif (@Rand >=0.50 and @Rand < 0.75) then alter table  T_Temp_Test drop `MoreValue`; 
  else alter table  T_Temp_Test drop `MoreValue2`; end if;                                                                                        
    
  select * from T_Temp_Test limit 10;
  set SESSION tx_isolation= @Current_Isolation_Level;
  SET @@sql_mode = @saved_sql_mode;
END
