2022-06-09 11:33:01 +00:00
|
|
|
CREATE SCHEMA IF NOT EXISTS `util`;
|
|
|
|
USE `util`;
|
|
|
|
|
|
|
|
DELIMITER ;;
|
|
|
|
DROP FUNCTION IF EXISTS `util`.`mockedDate`;
|
2023-01-16 14:18:00 +00:00
|
|
|
CREATE FUNCTION `util`.`mockedDate`()
|
2022-06-09 11:33:01 +00:00
|
|
|
RETURNS DATETIME
|
|
|
|
DETERMINISTIC
|
|
|
|
BEGIN
|
2023-01-30 14:15:27 +00:00
|
|
|
RETURN '2001-01-01 11:00:00';
|
2022-06-09 11:33:01 +00:00
|
|
|
END ;;
|
|
|
|
DELIMITER ;
|
|
|
|
|
|
|
|
DELIMITER ;;
|
|
|
|
DROP FUNCTION IF EXISTS `util`.`VN_CURDATE`;
|
2023-01-16 14:18:00 +00:00
|
|
|
CREATE FUNCTION `util`.`VN_CURDATE`()
|
2022-06-09 11:33:01 +00:00
|
|
|
RETURNS DATE
|
|
|
|
DETERMINISTIC
|
|
|
|
BEGIN
|
|
|
|
RETURN DATE(mockedDate());
|
|
|
|
END ;;
|
|
|
|
DELIMITER ;
|
|
|
|
|
|
|
|
DELIMITER ;;
|
|
|
|
DROP FUNCTION IF EXISTS `util`.`VN_CURTIME`;
|
2023-01-16 14:18:00 +00:00
|
|
|
CREATE FUNCTION `util`.`VN_CURTIME`()
|
2022-06-09 11:33:01 +00:00
|
|
|
RETURNS TIME
|
|
|
|
DETERMINISTIC
|
|
|
|
BEGIN
|
|
|
|
RETURN TIME(mockedDate());
|
|
|
|
END ;;
|
|
|
|
DELIMITER ;
|
|
|
|
|
|
|
|
DELIMITER ;;
|
|
|
|
DROP FUNCTION IF EXISTS `util`.`VN_NOW`;
|
2023-01-16 14:18:00 +00:00
|
|
|
CREATE FUNCTION `util`.`VN_NOW`()
|
2022-06-09 11:33:01 +00:00
|
|
|
RETURNS DATETIME
|
|
|
|
DETERMINISTIC
|
|
|
|
BEGIN
|
2023-01-16 14:18:00 +00:00
|
|
|
RETURN mockedDate();
|
2022-06-09 11:33:01 +00:00
|
|
|
END ;;
|
2023-01-16 14:18:00 +00:00
|
|
|
DELIMITER ;
|