diff --git a/db/routines/vn/functions/sale_hasComponentLack.sql b/db/routines/vn/functions/sale_hasComponentLack.sql index e066daca4..6d1b4ad01 100644 --- a/db/routines/vn/functions/sale_hasComponentLack.sql +++ b/db/routines/vn/functions/sale_hasComponentLack.sql @@ -1,5 +1,5 @@ DELIMITER $$ -CREATE OR REPLACE FUNCTION vn.sale_hasComponentLack(vSelf INT) +CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`sale_hasComponentLack`(vSelf INT) RETURNS tinyint(1) READS SQL DATA BEGIN @@ -12,7 +12,7 @@ BEGIN WITH componentRequired AS( SELECT COUNT(*)total - FROM component + FROM vn.component WHERE isRequired )SELECT SUM(IF(c.isRequired, TRUE, FALSE)) <> cr.total INTO vHasComponentLack FROM vn.sale s