salix/db/routines/util/functions/isLeapYear.sql

11 lines
221 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`isLeapYear`(vYear INT)
RETURNS tinyint(1)
DETERMINISTIC
BEGIN
RETURN (DAYOFYEAR(CONCAT(vYear, "-02-29")) IS NOT NULL);
END$$
DELIMITER ;