Merge pull request 'catalogue fixed' (!2267) from 6021-floranet_RedMoon into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2267 Reviewed-by: Pablo Natek <pablone@verdnatura.es>
This commit is contained in:
commit
90b7d2c3d8
|
@ -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