
DROP PROCEDURE IF EXISTS fillupdate;

DELIMITER //
CREATE PROCEDURE fillupdate()
BEGIN
  DECLARE nbdate INT DEFAULT 0;
  DECLARE dt DATETIME DEFAULT 0;
  SET dt = '2016-01-01';
  
  while nbdate < 365 do
	set nbdate = nbdate + 1;
    set dt = date_add(dt, interval 1 day);
    INSERT INTO dates(dt) values(dt);
    
  end while;
END;
//
DELIMITER ;

call fillupdate();