fork download
  1. -- your code goes here
  2. delimiter #
  3. drop procedure test;
  4. create procedure test ()
  5. BEGIN
  6. SET @current_timestamp := unix_timestamp(current_time) / 86400 * 86400;
  7. SET @i := 0;
  8. SET @cksum := 0;
  9. WHILE @i < 10000000 do
  10. SET @cksum := @cksum + from_unixtime(@current_timestamp + @i, '%Y');
  11. SET @i = @i + 1;
  12. END WHILE;
  13. SELECT @cksum;
  14. END
  15. #
  16.  
  17. call test();
  18. +-------------+
  19. | @cksum |
  20. +-------------+
  21. | 20142146877 |
  22. +-------------+
  23. 1 row in set (5 min 35.03 sec)
Runtime error #stdin #stdout #stderr 0s 3008KB
stdin
Standard input is empty
stdout

	
stderr
Error: near line 2: near "delimiter": syntax error
Error: near line 4: near "procedure": syntax error
Error: near line 7: near "SET": syntax error
Error: near line 8: near "SET": syntax error
Error: near line 9: near "WHILE": syntax error
Error: near line 11: near "SET": syntax error
Error: near line 12: near "WHILE": syntax error
Error: near line 14: unrecognized token: "#"
Error: incomplete SQL: +-------------+
| @cksum      |
+-------------+
| 20142146877 |
+-------------+
1 row in set (5 min 35.03 sec)