catalogue fixed
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
9af87f5cf2
commit
2eb229adf7
|
@ -4,7 +4,7 @@ DELIMITER $$
|
||||||
$$
|
$$
|
||||||
CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.catalogue_get(vLanded DATE, vPostalCode VARCHAR(15))
|
CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.catalogue_get(vLanded DATE, vPostalCode VARCHAR(15))
|
||||||
READS SQL DATA
|
READS SQL DATA
|
||||||
BEGIN
|
proc:BEGIN
|
||||||
/**
|
/**
|
||||||
* Returns list, price and all the stuff regarding the floranet items
|
* Returns list, price and all the stuff regarding the floranet items
|
||||||
*
|
*
|
||||||
|
@ -12,10 +12,22 @@ BEGIN
|
||||||
* @param vPostalCode Delivery address postal code
|
* @param vPostalCode Delivery address postal code
|
||||||
*/
|
*/
|
||||||
DECLARE vLastCatalogueFk INT;
|
DECLARE vLastCatalogueFk INT;
|
||||||
|
DECLARE vLockName VARCHAR(20);
|
||||||
|
DECLARE vLockTime INT;
|
||||||
|
|
||||||
START TRANSACTION;
|
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||||
|
BEGIN
|
||||||
|
DO RELEASE_LOCK(vLockName);
|
||||||
|
|
||||||
SELECT * FROM catalogue FOR UPDATE;
|
RESIGNAL;
|
||||||
|
END;
|
||||||
|
|
||||||
|
SET vLockName = 'catalogue_get';
|
||||||
|
SET vLockTime = 15;
|
||||||
|
|
||||||
|
IF NOT GET_LOCK(vLockName, vLockTime) THEN
|
||||||
|
LEAVE proc;
|
||||||
|
END IF;
|
||||||
|
|
||||||
SELECT MAX(id) INTO vLastCatalogueFk
|
SELECT MAX(id) INTO vLastCatalogueFk
|
||||||
FROM catalogue;
|
FROM catalogue;
|
||||||
|
@ -46,7 +58,7 @@ BEGIN
|
||||||
FROM catalogue
|
FROM catalogue
|
||||||
WHERE id > IFNULL(vLastCatalogueFk,0);
|
WHERE id > IFNULL(vLastCatalogueFk,0);
|
||||||
|
|
||||||
COMMIT;
|
DO RELEASE_LOCK(vLockName);
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -13,7 +13,8 @@ BEGIN
|
||||||
i.longName
|
i.longName
|
||||||
FROM vn.item i
|
FROM vn.item i
|
||||||
JOIN vn.itemType it ON it.id = i.typeFk
|
JOIN vn.itemType it ON it.id = i.typeFk
|
||||||
WHERE it.code IN ('FNR','FNP');
|
WHERE it.code IN ('FNR','FNP')
|
||||||
|
LIMIT 3;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
Loading…
Reference in New Issue